require 'rspec' require_relative '../test_connections' require 'sync/sync_project_service' require 'projects/client_service' settings = OpenStruct.new settings.project_p4_url = 'p4://p4d.example.com:1666' settings.default_stream_depot = '//projects' randstr = (0...8).map { (65 + rand(26)).chr }.join test_name = "Test Project #{randstr}" test_id = "test_project_#{randstr.downcase}" randstr2 = (0...8).map { (65 + rand(26)).chr }.join test_name_2 = "Second Project #{randstr}" test_id_2 = "second_project_#{randstr.downcase}" RSpec.describe Projects::ClientService, '#create_workspace' do it 'should create a new client for a stream project' do temp_client_as_jdoe do |p4, root| project_service = Sync::SyncProjectService.new( p4: p4, client_name: p4.client, client_root: root, settings: settings ) project = HelixWebServicesClient::Models::Project.new({ name: test_name }) project_service.create(project) client_service = Projects::ClientService.new(p4: p4) client_name = client_service.create_workspace( project: test_id, hostname: 'example.com', root: "/tmp/test/#{test_id}" ) spec = p4.fetch_client(client_name) expect(spec).to_not be_nil expect(spec._stream).to_not be_nil expect(spec._root).to eq("/tmp/test/#{test_id}") expect(spec._host).to eq('example.com') end end it 'should create a new client for a depot reference' do temp_client_as_jdoe do |p4, root| project_service = Sync::SyncProjectService.new( p4: p4, client_name: p4.client, client_root: root, settings: settings ) project = HelixWebServicesClient::Models::Project.new( { name: test_name_2, owner: 'jdoe', members: ['super', 'mmustermann'], branches: [ { id: 'master', name: 'master', view: [ { depot_path: '//depot/test_project/master/...', view_path: '...' } ] } ] }) project_service.create(project) client_service = Projects::ClientService.new(p4: p4) client_name = client_service.create_workspace( project: test_id_2, hostname: 'example.com', root: "/tmp/test/#{test_id_2}" ) spec = p4.fetch_client(client_name) expect(spec).to_not be_nil expect(spec._stream).to be_nil expect(spec._root).to eq("/tmp/test/#{test_id_2}") expect(spec._host).to eq('example.com') expect(spec._view).to_not be_nil end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 15227 | tjuricek |
Revise implementation, tests, and documentation for protections management. Remove some specs I will not be revising from the helix_web_services project. |
||
#1 | 15032 | tjuricek |
Starting config and doc revisions. System is now broken while revisions underway. Configuration of the p4d connection is now done via a single HWSSettings middleware object injected into the Rack env. The HWSP4Cleanup middleware now cleans up any p4 injected into the Rack env. The Auth::App class now mostly just contains one method to generate a p4 ticket. /auth/v1/login. Added yard documentation for the main project. Yard docs have been reconfigured to dump into build/ directories. This should probably be done with each release. Hm... The top level rake file contains a task, 'all:doc', to update our documentation. This should probably be run for each checkin. Hm... Specs are now using Rack::Test on top of a 'live' p4d. I'd suggest you still use the p4util mechanism, which now dumps to a /tmp folder, so we can safely add P4IGNORE rules back into your local .p4config file. Old 'perforce' application now called 'helix_versioning_engine'. Removing cache data. Helix Sync may be slow. It may also get axed. We'll see. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services/spec/projects/client_service_spec.rb | |||||
#1 | 14049 | tjuricek |
Add methods to generate client workspaces for a user. The Qt SDK was updated based on immediate need. Also, add Ruby client SDK documentation to the docs site. Everything is early, but there's *some* reference available at least. |