Sha256: 3d8d9987d63f120e8e4bd0fab159087e2f45bbdd45138fd31730d3b0e3b4b0de

Contents?: true

Size: 1.27 KB

Versions: 75

Compression:

Stored size: 1.27 KB

Contents

require 'git_utils'
require 'r10k_utils'
require 'master_manipulator'
require 'digest/sha1'
test_name 'CODEMGMT-101 - C59261 - Attempt to Deploy Environment with Broken Git Remote'

#Init
git_control_remote = '/git_repos/environments.git'
prod_branch_head_ref_path = File.join(git_control_remote, 'refs', 'heads', 'production')
prod_branch_head_ref_path_backup = '/tmp/production.bak'
r10k_fqp = get_r10k_fqp(master)

invalid_sha_ref = Digest::SHA1.hexdigest('broken')

#Verification
error_message_regex = /ERROR\].*Blah/m

#Teardown
teardown do
  step 'Restore Original "production" Branch Head Ref'
  on(master, "mv #{prod_branch_head_ref_path_backup} #{prod_branch_head_ref_path}")
end

#Setup
step 'Backup Current "production" Branch Head Ref'
on(master, "mv #{prod_branch_head_ref_path} #{prod_branch_head_ref_path_backup}")

step 'Inject Corrupt "production" Branch Head Ref'
create_remote_file(master, prod_branch_head_ref_path, "#{invalid_sha_ref}\n")
on(master, "chmod 644 #{prod_branch_head_ref_path}")

#Tests
step 'Attempt to Deploy via r10k'
on(master, "#{r10k_fqp} deploy environment -v -t", :acceptable_exit_codes => [0,1]) do |result|
  expect_failure('Expected to fail due to RK-28') do
    assert_match(error_message_regex, result.stderr, 'Expected message not found!')
  end
end

Version data entries

75 entries across 75 versions & 2 rubygems

Version Path
r10k-5.0.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-4.1.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-4.0.2 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-4.0.1 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-4.0.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-4.0.0.pre integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.16.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.15.4 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.15.3 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.15.2 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.15.1 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.15.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
akerl-r10k-3.14.2.1 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.14.2 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.14.1 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.14.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.13.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.12.1 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.12.0 integration/tests/git_source/negative/neg_git_broken_remote.rb
r10k-3.11.0 integration/tests/git_source/negative/neg_git_broken_remote.rb