beaker-puppet 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0c0f5f48d98807a525e40040785d89a753d4400
4
- data.tar.gz: 8c52841347557eb0ecd41a71082ddeb2d68ba99c
3
+ metadata.gz: d6082215f1011bfa1a62afb5863e4d207477fe23
4
+ data.tar.gz: 5f43469bc7a545f5bbda83d78b5425120723e1f3
5
5
  SHA512:
6
- metadata.gz: 04feeac68d4174b1e66ef49348464856c0af0a27ac879a6f1bbca8adebd30c7253665237d221d2431551fa6dfc4389704fc8e360744b712c29e3c7469ef185ed
7
- data.tar.gz: e874c30beb9edd42b9bc31f702b2941d4b1ed919df87c736e16c8435113df8d4659f36453ee6f49e84e86e103079e574fbf78eedaf2f02b2fdc763412ea00c3f
6
+ metadata.gz: f0023d9eb1b559504e4994f7b233d3d8e80f63618f865a0f6c1d0358c9dc08ee7596cd6f852f16c8ce8c2d2c9f81b5231822c6727a84664fa5cce8395440fc1e
7
+ data.tar.gz: 9a49f5b8afbe19505f5002fcfa9409f979fc6da8a970f8dc442a06e2c085772142786d9fd43d91ebf8164eccf57513d265497340b6fcd4e486d3f5949dfefdf9
@@ -8,11 +8,11 @@ module Beaker
8
8
 
9
9
  #Here be the default download URLs
10
10
  FOSS_DEFAULT_DOWNLOAD_URLS = {
11
- :win_download_url => "http://downloads.puppetlabs.com/windows",
12
- :mac_download_url => "http://downloads.puppetlabs.com/mac",
13
- :pe_promoted_builds_url => "http://pm.puppetlabs.com",
14
- :release_apt_repo_url => "http://apt.puppetlabs.com",
15
- :release_yum_repo_url => "http://yum.puppetlabs.com",
11
+ :win_download_url => "http://downloads.puppet.com/windows",
12
+ :mac_download_url => "http://downloads.puppet.com/mac",
13
+ :pe_promoted_builds_url => "http://pm.puppet.com",
14
+ :release_apt_repo_url => "http://apt.puppet.com",
15
+ :release_yum_repo_url => "http://yum.puppet.com",
16
16
  :nightly_apt_repo_url => "http://nightlies.puppet.com/apt",
17
17
  :nightly_yum_repo_url => "http://nightlies.puppet.com/yum",
18
18
  :nightly_win_download_url => "http://nightlies.puppet.com/downloads/windows",
@@ -1,3 +1,3 @@
1
1
  module BeakerPuppet
2
- VERSION = '1.12.0'
2
+ VERSION = '1.13.0'
3
3
  end
@@ -312,11 +312,11 @@ describe ClassMixedWithDSLInstallUtils do
312
312
 
313
313
  it 'installs puppet on cygwin windows' do
314
314
  allow(subject).to receive(:link_exists?).and_return( true )
315
- expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.7.1-x64.msi\" -O http://downloads.puppetlabs.com/windows/puppet-3.7.1-x64.msi")
315
+ expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.7.1-x64.msi\" -O http://downloads.puppet.com/windows/puppet-3.7.1-x64.msi")
316
316
  expect(subject).to receive(:on).with(winhost, " echo 'export PATH=$PATH:\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"' > /etc/bash.bashrc ")
317
317
  expect(subject).to receive(:install_msi_on).with(winhost, "#{win_temp}\\puppet-3.7.1-x64.msi", {}, {:debug => nil})
318
318
 
319
- subject.install_puppet_from_msi( winhost, {:version => '3.7.1', :win_download_url => 'http://downloads.puppetlabs.com/windows'} )
319
+ subject.install_puppet_from_msi( winhost, {:version => '3.7.1', :win_download_url => 'http://downloads.puppet.com/windows'} )
320
320
  end
321
321
 
322
322
  it 'installs puppet on non-cygwin windows' do
@@ -326,12 +326,12 @@ describe ClassMixedWithDSLInstallUtils do
326
326
 
327
327
  expect(subject).to receive(:on).with(winhost_non_cygwin, instance_of( Beaker::Command )) do |host, beaker_command|
328
328
  expect(beaker_command.command).to eq('powershell.exe')
329
- expect(beaker_command.args).to eq(["-ExecutionPolicy Bypass", "-InputFormat None", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command $webclient = New-Object System.Net.WebClient; $webclient.DownloadFile('http://downloads.puppetlabs.com/windows/puppet-3.7.1.msi','#{win_temp}\\puppet-3.7.1.msi')"])
329
+ expect(beaker_command.args).to eq(["-ExecutionPolicy Bypass", "-InputFormat None", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command $webclient = New-Object System.Net.WebClient; $webclient.DownloadFile('http://downloads.puppet.com/windows/puppet-3.7.1.msi','#{win_temp}\\puppet-3.7.1.msi')"])
330
330
  end.once
331
331
 
332
332
  expect(subject).to receive(:install_msi_on).with(winhost_non_cygwin, "#{win_temp}\\puppet-3.7.1.msi", {}, {:debug => nil})
333
333
 
334
- subject.install_puppet_from_msi( winhost_non_cygwin, {:version => '3.7.1', :win_download_url => 'http://downloads.puppetlabs.com/windows'} )
334
+ subject.install_puppet_from_msi( winhost_non_cygwin, {:version => '3.7.1', :win_download_url => 'http://downloads.puppet.com/windows'} )
335
335
  end
336
336
  end
337
337
 
@@ -544,7 +544,7 @@ describe ClassMixedWithDSLInstallUtils do
544
544
  if host != winhost
545
545
  allow(subject).to receive(:on).with(host, anything)
546
546
  else
547
- expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.msi\" -O http://downloads.puppetlabs.com/windows/puppet-3.msi")
547
+ expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.msi\" -O http://downloads.puppet.com/windows/puppet-3.msi")
548
548
  expect(subject).to receive(:on).with(winhost, " echo 'export PATH=$PATH:\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"' > /etc/bash.bashrc ")
549
549
  expect(subject).to receive(:install_msi_on).with(winhost, "#{win_temp}\\puppet-3.msi", {}, {:debug => nil}).exactly(1).times
550
550
  end
@@ -556,11 +556,11 @@ describe ClassMixedWithDSLInstallUtils do
556
556
  if host != winhost
557
557
  allow(subject).to receive(:on).with(host, anything)
558
558
  else
559
- expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.msi\" -O http://nightlies.puppetlabs.com/puppet-latest/repos/windows/puppet-3.msi")
559
+ expect(subject).to receive(:on).with(winhost, "curl -o \"#{win_temp}\\puppet-3.msi\" -O http://nightlies.puppet.com/puppet-latest/repos/windows/puppet-3.msi")
560
560
  expect(subject).to receive(:install_msi_on).with(winhost, "#{win_temp}\\puppet-3.msi", {}, {:debug => nil})
561
561
  end
562
562
  end
563
- subject.install_puppet( :version => '3', :win_download_url => 'http://nightlies.puppetlabs.com/puppet-latest/repos/windows' )
563
+ subject.install_puppet( :version => '3', :win_download_url => 'http://nightlies.puppet.com/puppet-latest/repos/windows' )
564
564
  end
565
565
  end
566
566
  describe 'on unsupported platforms' do
@@ -873,7 +873,7 @@ describe ClassMixedWithDSLInstallUtils do
873
873
  end
874
874
 
875
875
  describe '#msi_link_path' do
876
- let( :opts ) { { :puppet_agent_version => 'VERSION', :win_download_url => 'http://downloads.puppetlabs.com/windows' } }
876
+ let( :opts ) { { :puppet_agent_version => 'VERSION', :win_download_url => 'http://downloads.puppet.com/windows' } }
877
877
  let( :platform ) { 'windows' }
878
878
  let( :host ) { { :platform => platform, 'dist' => 'puppet-agent-VERSION-x64' } }
879
879
 
@@ -894,12 +894,12 @@ describe ClassMixedWithDSLInstallUtils do
894
894
 
895
895
  expect{
896
896
  subject.msi_link_path( host, opts )
897
- }.to raise_error(RuntimeError, /Puppet MSI at http:\/\/downloads.puppetlabs.com\/windows\/puppet-agent-VERSION-x64.msi does not exist!/)
897
+ }.to raise_error(RuntimeError, /Puppet MSI at http:\/\/downloads.puppet.com\/windows\/puppet-agent-VERSION-x64.msi does not exist!/)
898
898
  end
899
899
  end
900
900
 
901
901
  describe '#install_puppet_agent_from_msi_on' do
902
- let( :opts ) { { :puppet_agent_version => 'VERSION', :win_download_url => 'http://downloads.puppetlabs.com/windows' } }
902
+ let( :opts ) { { :puppet_agent_version => 'VERSION', :win_download_url => 'http://downloads.puppet.com/windows' } }
903
903
  let( :platform ) { 'windows' }
904
904
  let( :host ) { { :platform => platform } }
905
905
 
@@ -1351,7 +1351,7 @@ describe ClassMixedWithDSLInstallUtils do
1351
1351
  context 'when setting different agent versions' do
1352
1352
  let( :host ) { basic_hosts.first }
1353
1353
  let( :platform ) { Object.new() }
1354
- let( :downloadurl ) { 'http://pm.puppetlabs.com' }
1354
+ let( :downloadurl ) { 'http://pm.puppet.com' }
1355
1355
  before :each do
1356
1356
  allow( platform ).to receive( :to_array ) { ['el', '6', 'x4'] }
1357
1357
  allow( subject ).to receive( :options ).and_return( opts )
@@ -1365,8 +1365,18 @@ describe ClassMixedWithDSLInstallUtils do
1365
1365
  collection = 'PC1'
1366
1366
  opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}" }
1367
1367
 
1368
- expect( subject ).to receive( :fetch_http_file ).once.with( /pm\.puppetlabs\.com\/puppet-agent\/.*\/#{agentversion}\/repos/, /puppet-agent-el-6*/, /\/el$/ )
1369
- expect( host).to receive( :pe_puppet_agent_promoted_package_install ).with( anything, /puppet-agent-el-6*/, /.*\/el\/6\/#{collection}\/.*rpm/, /puppet-agent-el-6/, anything )
1368
+ expect(subject).to receive(:fetch_http_file).once.with(
1369
+ /pm\.puppet\.com\/puppet-agent\/.*\/#{agentversion}\/repos/,
1370
+ /puppet-agent-el-6*/,
1371
+ /\/el$/
1372
+ )
1373
+ expect(host).to receive(:pe_puppet_agent_promoted_package_install).with(
1374
+ anything,
1375
+ /puppet-agent-el-6*/,
1376
+ /.*\/el\/6\/#{collection}\/.*rpm/,
1377
+ /puppet-agent-el-6/,
1378
+ anything
1379
+ )
1370
1380
  subject.install_puppet_agent_pe_promoted_repo_on( host, opts )
1371
1381
  end
1372
1382
 
@@ -1376,8 +1386,17 @@ describe ClassMixedWithDSLInstallUtils do
1376
1386
  collection = 'PC1'
1377
1387
  opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}"}
1378
1388
 
1379
- expect( subject ).to receive( :fetch_http_file ).once.with( /pm\.puppetlabs\.com\/puppet-agent\/.*\/#{agentversion}\/repos/, /puppet-agent-el-6*/, /\/el$/ )
1380
- expect( host).to receive( :pe_puppet_agent_promoted_package_install ).with( anything, /puppet-agent-el-6*/, /.*\/el\/6\/#{collection}\/.*rpm/, /puppet-agent-el-6/, anything )
1389
+ expect(subject).to receive(:fetch_http_file).once.with(
1390
+ /pm\.puppet\.com\/puppet-agent\/.*\/#{agentversion}\/repos/,
1391
+ /puppet-agent-el-6*/,/\/el$/
1392
+ )
1393
+ expect(host).to receive(:pe_puppet_agent_promoted_package_install).with(
1394
+ anything,
1395
+ /puppet-agent-el-6*/,
1396
+ /.*\/el\/6\/#{collection}\/.*rpm/,
1397
+ /puppet-agent-el-6/,
1398
+ anything
1399
+ )
1381
1400
  subject.install_puppet_agent_pe_promoted_repo_on( host, opts )
1382
1401
  end
1383
1402
 
@@ -1387,8 +1406,18 @@ describe ClassMixedWithDSLInstallUtils do
1387
1406
  collection = 'puppet5'
1388
1407
  opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}"}
1389
1408
 
1390
- expect( subject ).to receive( :fetch_http_file ).once.with( /pm\.puppetlabs\.com\/puppet-agent\/.*\/#{agentversion}\/repos/, /puppet-agent-el-6*/, /\/el$/ )
1391
- expect( host).to receive( :pe_puppet_agent_promoted_package_install ).with( anything, /puppet-agent-el-6*/, /.*\/el\/6\/#{collection}\/.*rpm/, /puppet-agent-el-6/, anything )
1409
+ expect(subject).to receive(:fetch_http_file).once.with(
1410
+ /pm\.puppet\.com\/puppet-agent\/.*\/#{agentversion}\/repos/,
1411
+ /puppet-agent-el-6*/,
1412
+ /\/el$/
1413
+ )
1414
+ expect(host).to receive(:pe_puppet_agent_promoted_package_install).with(
1415
+ anything,
1416
+ /puppet-agent-el-6*/,
1417
+ /.*\/el\/6\/#{collection}\/.*rpm/,
1418
+ /puppet-agent-el-6/,
1419
+ anything
1420
+ )
1392
1421
  subject.install_puppet_agent_pe_promoted_repo_on( host, opts )
1393
1422
  end
1394
1423
 
@@ -1398,8 +1427,18 @@ describe ClassMixedWithDSLInstallUtils do
1398
1427
  collection = 'puppet6'
1399
1428
  opts = { :puppet_agent_version => "#{agentversion}" , :pe_promoted_builds_url => "#{downloadurl}"}
1400
1429
 
1401
- expect( subject ).to receive( :fetch_http_file ).once.with( /pm\.puppetlabs\.com\/puppet-agent\/.*\/#{agentversion}\/repos/, /puppet-agent-el-6*/, /\/el$/ )
1402
- expect( host).to receive( :pe_puppet_agent_promoted_package_install ).with( anything, /puppet-agent-el-6*/, /.*\/el\/6\/#{collection}\/.*rpm/, /puppet-agent-el-6/, anything )
1430
+ expect(subject).to receive(:fetch_http_file).once.with(
1431
+ /pm\.puppet\.com\/puppet-agent\/.*\/#{agentversion}\/repos/,
1432
+ /puppet-agent-el-6*/,
1433
+ /\/el$/
1434
+ )
1435
+ expect(host).to receive(:pe_puppet_agent_promoted_package_install).with(
1436
+ anything,
1437
+ /puppet-agent-el-6*/,
1438
+ /.*\/el\/6\/#{collection}\/.*rpm/,
1439
+ /puppet-agent-el-6/,
1440
+ anything
1441
+ )
1403
1442
  subject.install_puppet_agent_pe_promoted_repo_on( host, opts )
1404
1443
  end
1405
1444
  end
@@ -1451,11 +1490,11 @@ describe ClassMixedWithDSLInstallUtils do
1451
1490
  end
1452
1491
 
1453
1492
  describe '#get_latest_puppet_agent_build_from_url' do
1454
- let(:urls) {['https://downloads.puppetlabs.com/mac/10.9/PC1/x86_64',
1455
- 'https://downloads.puppetlabs.com/mac/10.10/PC1/x86_64',
1456
- 'https://downloads.puppetlabs.com/mac/10.11/PC1/x86_64',
1457
- 'https://downloads.puppetlabs.com/mac/10.12/PC1/x86_64',
1458
- 'https://downloads.puppetlabs.com/windows']}
1493
+ let(:urls) {['https://downloads.puppet.com/mac/10.9/PC1/x86_64',
1494
+ 'https://downloads.puppet.com/mac/10.10/PC1/x86_64',
1495
+ 'https://downloads.puppet.com/mac/10.11/PC1/x86_64',
1496
+ 'https://downloads.puppet.com/mac/10.12/PC1/x86_64',
1497
+ 'https://downloads.puppet.com/windows']}
1459
1498
 
1460
1499
  it "gets the right version" do
1461
1500
  urls.each do |url|
data/tasks/ci.rake CHANGED
@@ -3,6 +3,7 @@ require 'pp'
3
3
  require 'yaml'
4
4
  require 'securerandom'
5
5
  require 'fileutils'
6
+ require 'tempfile'
6
7
  require 'beaker-hostgenerator'
7
8
  require 'beaker/dsl/install_utils'
8
9
  extend Beaker::DSL::InstallUtils
@@ -172,14 +173,28 @@ namespace :ci do
172
173
 
173
174
  namespace :test do
174
175
  desc <<-EOS
175
- Run the acceptance tests using puppet-agent (AIO) packages.
176
+ Run the acceptance tests using puppet-agent (AIO) packages, with or without
177
+ retrying failed tests one time.
176
178
 
177
179
  $ SHA=<full sha> bundle exec rake ci:test:aio
178
180
 
181
+ or
182
+
183
+ $ SHA=<full sha> bundle exec rake ci:test:aio[RETRIES]
184
+
185
+
179
186
  SHA should be the full SHA for the puppet-agent package.
187
+
188
+ RETRIES should be set to true to retry failed tests one time. It defaults
189
+ to false.
180
190
  EOS
181
- task :aio => ['ci:check_env', 'ci:gen_hosts'] do
182
- beaker_suite(:aio)
191
+ task :aio, [:retries] => ['ci:check_env', 'ci:gen_hosts'] do |t, args|
192
+ args.with_defaults(retries: false)
193
+ if args[:retries]
194
+ beaker_suite_retry(:aio)
195
+ else
196
+ beaker_suite(:aio)
197
+ end
183
198
  end
184
199
 
185
200
  desc <<-EOS
@@ -193,11 +208,13 @@ EOS
193
208
  task :gem => ['ci:check_env'] do
194
209
  beaker(:init, '--hosts', 'config/nodes/gem.yaml', '--options-file', 'config/gem/options.rb')
195
210
  beaker(:provision)
196
- beaker(:exec, 'pre-suite', '--pre-suite', pre_suites(:gem))
197
- beaker(:exec, "#{File.dirname(__dir__)}/setup/gem/010_GemInstall.rb")
198
-
199
- preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
200
- beaker(:destroy) unless preserve_hosts
211
+ begin
212
+ beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(:gem))
213
+ beaker(:exec, "#{File.dirname(__dir__)}/setup/gem/010_GemInstall.rb")
214
+ ensure
215
+ preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
216
+ beaker(:destroy) unless preserve_hosts
217
+ end
201
218
  end
202
219
 
203
220
  desc <<-EOS
@@ -243,13 +260,40 @@ end
243
260
  def beaker_suite(type)
244
261
  beaker(:init, '--hosts', ENV['HOSTS'], '--options-file', "config/#{String(type)}/options.rb")
245
262
  beaker(:provision)
246
- beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(type))
247
- beaker(:exec, 'pre-suite', '--preserve-state')
248
- beaker(:exec, ENV['TESTS'])
249
- beaker(:exec, 'post-suite')
250
263
 
251
- preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
252
- beaker(:destroy) unless preserve_hosts
264
+ begin
265
+ beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(type))
266
+ beaker(:exec, 'pre-suite', '--preserve-state')
267
+ beaker(:exec, ENV['TESTS'])
268
+ beaker(:exec, 'post-suite')
269
+ ensure
270
+ preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
271
+ beaker(:destroy) unless preserve_hosts
272
+ end
273
+ end
274
+
275
+ def beaker_suite_retry(type)
276
+ beaker(:init, '--hosts', ENV['HOSTS'], '--options-file', "config/#{String(type)}/options.rb")
277
+ beaker(:provision)
278
+
279
+ begin
280
+ json_results_file = Tempfile.new
281
+
282
+ beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(type))
283
+ beaker(:exec, 'pre-suite', '--preserve-state')
284
+ beaker(:exec, ENV['TESTS'], '--test-results-file', json_results_file.path)
285
+ rescue RuntimeError
286
+ tests_to_rerun = JSON.load(File.read(json_results_file.path))
287
+ if tests_to_rerun.length > 0
288
+ puts '*** Retrying the following:'
289
+ puts tests_to_rerun.map { |spec| " #{spec}" }
290
+ beaker(:exec, tests_to_rerun.map { |str| "#{str}" }.join(',') )
291
+ end
292
+ ensure
293
+ beaker(:exec, 'post-suite')
294
+ preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
295
+ beaker(:destroy) unless preserve_hosts
296
+ end
253
297
  end
254
298
 
255
299
  def pre_suites(type)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-30 00:00:00.000000000 Z
11
+ date: 2018-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec