# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require 'rspec' require 'helix_web_services_client' require_relative './test_config' RSpec.describe "HelixWebServicesClient branches" do randstr = (0...8).map { (65 + rand(26)).chr }.join new_branch = { 'Branch' => "new_branch_#{randstr}", 'Description' => 'Something for the kids', 'View' => ['//depot/dev/kids/... //depot/main/kids/...'] } it 'should create a new branch - and return it via #branches' do client_as_jdoe do |c| skip 'Not available for cloud (no stream support)' if cloud_test? c.create_branch(new_branch) branches = c.branches expect(branches.map(&:branch)).to include(new_branch['Branch']) end end it 'should load a single branch created via #create_branch' do client_as_jdoe do |c| new_branch = c.branch(new_branch['Branch']) expect(new_branch.description).to include(new_branch['Description']) expect(new_branch.view.length).to eq(1) expect(new_branch.view.first).to eq(new_branch['View'].first) end end it 'should be able to update the branch description' do client_as_jdoe do |c| skip 'Not available for cloud (no stream support)' if cloud_test? to_update = c.branch(new_branch['Branch']) to_update.Description = 'updated' c.update_branch(to_update) loaded = c.branch(new_branch['Branch']) expect(loaded.description).to include('updated') end end it 'should be able to delete a branch created via #create_branch' do client_as_jdoe do |c| skip 'Not available for cloud (no stream support)' if cloud_test? c.delete_branch(new_branch['Branch']) branches = c.branches expect(branches.map(&:branch)).to_not include(new_branch['Branch']) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 16271 | Doug Scheirer |
- delete the default //depot for cloud tests - mark more tests as pending - refactored sync tests a little to make cloud compatib;e - fixed a bug in the sync 'locked' logic |
||
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/spec/branches_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/branches_spec.rb | |||||
#1 | 15077 | tjuricek |
Add new 'model' technique, revised branch spec operations, test Auth::Middleware. The Ruby client now does *not* strictly type anything, but extends OpenStruct with helper methods to help deal with inconsistent data formats. See the OpenModel class documentation for more details. The Auth::Middleware class is also *finally* implemented as well. This does not take into account all possible variations of server behavior (yet), but that will happen in follow-up work. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/branches_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/branches_spec.rb | |||||
#1 | 13799 | tjuricek |
Start with branch specs hosting in a new monolithic 'helix web services' project. Converting from a microservice to a monolithic architecture due to resource constraints at getting a deployable system running. Additionally, since it's not expected that people will upgrade often, the major benefit of microservices - being able to add services individually without affecting others - is not really a major benefit. The Ruby SDK will be consolidated into a single 'helix web services client' project. It may end up being distributed via Rubygems. This only runs branch specs at the moment. I want to get a CD pipeline setup for the monolithic server before revising more methods. |