# Copyright (c) 2014 Perforce Software, Inc. All rights reserved. require 'rspec' require 'helix_web_services_client' require_relative './test_config' RSpec.describe 'HelixWebServicesClient changes' do it 'should list change 1' do client_as_jdoe do |c| changes = c.changes expect(changes.length).to be >= 1 expect(changes.map(&:change)).to include('1') end end it 'should describe two files in change 1' do client_as_jdoe do |c| change = c.change('1') expect(change.depot_file.length).to eq(2) end end it 'should allow us to integrate' do randstr = (0...8).map { (65 + rand(26)).chr }.join client_as_jdoe do |c| c.create_change( 'Files' => [ { 'DepotFile' => "//depot/test-#{randstr}/Experimental/...", 'FromDepotFile' => '//depot/dev/Experimental/...', 'Action' => 'branch' } ] ) files = c.files("//depot/test-#{randstr}/Experimental") expect(files.map(&:depot_file)).to include("//depot/test-#{randstr}/Experimental/README") end end it 'should allow us to upload two files to //depot/dev/Experimental' do randstr = (0...8).map { (65 + rand(26)).chr }.join client_as_jdoe do |c| c.create_change( 'Description' => 'Upload two experimental files', 'Files' => [ { 'DepotFile' => "//depot/dev/Experimental/teapot1-#{randstr}.txt", 'Action' => 'upload', 'Content' => "I'm a little teapot" }, { 'DepotFile' => "//depot/dev/Experimental/teapot2-#{randstr}.txt", 'Action' => 'upload', 'Content' => 'Short and stout!' } ] ) files = c.files('//depot/dev/Experimental') names = files.map(&:depot_file) expect(names).to include("//depot/dev/Experimental/teapot1-#{randstr}.txt") expect(names).to include("//depot/dev/Experimental/teapot2-#{randstr}.txt") end end it 'should be able to submit changes shelved on classic clients' do rand_str = (0...8).map { (65 + rand(26)).chr }.join relative_path = "depot/shelved_stuff/#{rand_str}" temp_client_as_jdoe do |p4, p4_root| path = File.absolute_path("#{p4_root}/#{relative_path}") unless Dir.exist?(File.dirname(path)) FileUtils.mkdir_p(File.dirname(path)) end IO.write(path, "I'm a little teapot") change_spec = p4.fetch_change change_spec._description = "Testing shelving for #{rand_str}" results = p4.save_change(change_spec) change_num = /^Change (\d+) created.$/.match(results.first)[1] #puts "change_num: #{change_num}" results = p4.run_add('-c', change_num, path) #puts "add: #{results}" results = p4.run_shelve('-c', change_num) #puts "shelve: #{results}" results = p4.run_revert('-c', change_num, path) #puts "revert: #{results}" client_as_jdoe do |c| c.commit_change(change_num) end end client_as_jdoe do |c| file = c.file(relative_path) expect(file.depot_file).to eq("//#{relative_path}") end end it 'should be able to submit changes shelved on stream clients' do rand_str = (0...8).map { (65 + rand(26)).chr }.join relative_path = "shelved_stuff/#{rand_str}" stream = nil temp_stream_client_as_jdoe do |p4, p4_root, s| stream = s path = File.absolute_path("#{p4_root}/#{relative_path}") unless Dir.exist?(File.dirname(path)) FileUtils.mkdir_p(File.dirname(path)) end IO.write(path, "I'm a little teapot") change_spec = p4.fetch_change change_spec._description = "Testing shelving for #{rand_str}" results = p4.save_change(change_spec) change_num = /^Change (\d+) created.$/.match(results.first)[1] #puts "change_num: #{change_num}" results = p4.run_add('-c', change_num, path) #puts "add: #{results}" results = p4.run_shelve('-c', change_num) #puts "shelve: #{results}" results = p4.run_revert('-c', change_num, path) #puts "revert: #{results}" client_as_jdoe do |c| c.commit_change(change_num) end end client_as_jdoe do |c| file = c.file("#{stream}/#{relative_path}") expect(file.depot_file).to eq("#{stream}/#{relative_path}") end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/spec/change_spec.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec/change_spec.rb | |||||
#3 | 15147 | tjuricek |
Enable submissions by files on stream clients This obeys our earlier rules: notably the local client must not have any local files open for edit. |
||
#2 | 15132 | tjuricek | Provde a basic submit -e mechanism on classic perforce workspaces. | ||
#1 | 15110 | tjuricek | Revise changes methods for new p4 connection handling, add server specs, remove model references in client, and update asciidoc documentation. | ||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/change_spec.rb | |||||
#1 | 15053 | tjuricek |
Revise the client API to use the new login method. The current specs will need to be revised since data normalization is moving out of the server and into the client. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec/perforce/change_spec.rb | |||||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. | ||
//guest/perforce_software/helix-web-services/main/p4_web_api/clients/ruby/p4_web_api_client/spec/change_spec.rb | |||||
#2 | 13474 | tjuricek | Corrected regressions that broke the API and Project services specs. | ||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |