beaker 2.38.1 → 2.39.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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTlkMmEzMzc3MDkyN2Q0NGIwZWQ2YmRjZGUyNDFlYzFmNmQ3OGQ2MA==
4
+ MGY4YTE4YjI3YmU5ZWE5ZjQxODA5Y2Y3OGU0ZTViMmRmNmRkODg0Mw==
5
5
  data.tar.gz: !binary |-
6
- MTNmYWMwZTQ0YWE3YzM1ZjJiYmQ3NDk1ZGMyNDViZTEwM2I3MTdiOA==
6
+ NDU0ZTJmYTg0ZjAyMTM1YTI2ZGQ4OTlhNTU2YzY0NGM0ZGFkYjNlZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTZiOGYxMDdmZjgxYjVkODBkOTA0NTVhZmY3OGE0OGQyNjIyMzlmNzUxOWU2
10
- Njg3OGMxZTAzZTZlYTI4Mzg4MGQyMzgzNWIyN2U1MmEzM2ZmZWY4ODAxM2M2
11
- NzViMmU1ZjVlMjhlYmFlYmJkZDY5NzYzOTc0MTg1ZmUwNzE5NjI=
9
+ YzhhMWM4NzIyZGU0Njg2NzcyZjI0MzQ1NzhmNjE2ZTUwNjU0NmE3MmQzOGIw
10
+ ZjhhYjk3Y2YzZjU3NTFhZTAyMDNhMzRlN2RhODJiYTQ5MzNiMjIyY2MzM2Vi
11
+ YTg5OTYzOGViNjkwYzM3ZTVjNzEyZGMxYzI0Zjg1OGU0ZGE3OTc=
12
12
  data.tar.gz: !binary |-
13
- YzZiNTYwMzU1MzA1ZmNjYTEwZWU3OTAxMDc5NTNkYTU4ZDYzOTU2NDRjNTI1
14
- ODA4Y2U0Mjg1NTY1ODdlZmI4NjgxNGMwZWIyYWY2MWQ4ZGQ5MjUzNzM1OWIz
15
- Njc5OWY0ZTNjMjU5N2VhNDcyZGNhZmRjNTA1NWY0ODRhNzMwZDI=
13
+ ODBmZjQ2NjE5MGZhZjRiZWEyZjlmMjE1NTBmYzgwMWRkM2YzZjBhYzFlZWY4
14
+ YWJjOWYwNTU3ZGYyYjU0YTQwZmJiZTBmOGZiMzIyMmRlYTA0MTQyNTU1OTVh
15
+ NjA4MTYxOTkwNjIzNTBhNWI0MzNlZDcxNDM1YWNjYzI2N2YwZGU=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 31 Mar, 2016 (e131537d)](#LATEST)
3
+ * [LATEST - 6 Apr, 2016 (1a0fe8ac)](#LATEST)
4
+ * [2.38.1 - 31 Mar, 2016 (124b91b8)](#2.38.1)
4
5
  * [2.38.0 - 30 Mar, 2016 (0878bff7)](#2.38.0)
5
6
  * [2.37.0 - 15 Mar, 2016 (a6c2297b)](#2.37.0)
6
7
  * [2.36.0 - 9 Mar, 2016 (5fd86b67)](#2.36.0)
@@ -114,7 +115,72 @@
114
115
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
115
116
 
116
117
  ## Details
117
- ### <a name = "LATEST">LATEST - 31 Mar, 2016 (e131537d)
118
+ ### <a name = "LATEST">LATEST - 6 Apr, 2016 (1a0fe8ac)
119
+
120
+ * (GEM) update beaker version to 2.39.0 (1a0fe8ac)
121
+
122
+ * Merge pull request #1083 from samwoods1/fix_junit_skipped (244d9706)
123
+
124
+
125
+ ```
126
+ Merge pull request #1083 from samwoods1/fix_junit_skipped
127
+
128
+ (maint) change junit skip to skipped to match schema
129
+ ```
130
+ * Merge pull request #1088 from puppetlabs/added-beaker-libraries (47fe09db)
131
+
132
+
133
+ ```
134
+ Merge pull request #1088 from puppetlabs/added-beaker-libraries
135
+
136
+ (maint) Add more libraries to Beaker-Libraries.md
137
+ ```
138
+ * Merge pull request #1086 from pinkypie/BKR-430 (4510c968)
139
+
140
+
141
+ ```
142
+ Merge pull request #1086 from pinkypie/BKR-430
143
+
144
+ (BKR-430) Adding rake tasks for running beaker acceptance tests.
145
+ ```
146
+ * Merge pull request #1089 from tvpartytonight/BKR-708 (307c231d)
147
+
148
+
149
+ ```
150
+ Merge pull request #1089 from tvpartytonight/BKR-708
151
+
152
+ (BKR-708) Add ubuntu xenial as a supported platform
153
+ ```
154
+ * (BKR-708) Add ubuntu xenial as a supported platform (8ef1e057)
155
+
156
+
157
+ ```
158
+ (BKR-708) Add ubuntu xenial as a supported platform
159
+
160
+ This change adds xenial support to beaker.
161
+ ```
162
+ * (maint) Add more libraries to Beaker-Libraries.md (26aab9b0)
163
+
164
+ * (BKR-430) Adding rake tasks for running Beaker acceptance tests. (e463effd)
165
+
166
+
167
+ ```
168
+ (BKR-430) Adding rake tasks for running Beaker acceptance tests.
169
+ 'rake acceptance' for the main acceptance run.
170
+ Also the following individual tasks for individual sets of tests.
171
+ rake test:base
172
+ rake test:hypervisor
173
+ rake test:puppetpe
174
+ rake test:puppetgem
175
+ rake test:puppetgit
176
+ rake test:puppetpkg
177
+ rake test:puppet
178
+ ```
179
+ * (maint) change junit skip to skipped to match schema (25b7abcc)
180
+
181
+ ### <a name = "2.38.1">2.38.1 - 31 Mar, 2016 (124b91b8)
182
+
183
+ * (HISTORY) update beaker history for gem release 2.38.1 (124b91b8)
118
184
 
119
185
  * (GEM) update beaker version to 2.38.1 (e131537d)
120
186
 
data/Rakefile CHANGED
@@ -1,4 +1,8 @@
1
1
  require 'open3'
2
+ require 'securerandom'
3
+ require 'beaker-hostgenerator'
4
+
5
+ HOSTS_PRESERVED = 'log/latest/hosts_preserved.yml'
2
6
 
3
7
  task :default => [ 'test:spec' ]
4
8
 
@@ -10,6 +14,10 @@ task :spec do
10
14
  Rake::Task['test:spec'].invoke
11
15
  end
12
16
 
17
+
18
+ task :acceptance => ['test:base', 'test:puppetgit', 'test:hypervisor']
19
+
20
+
13
21
  task :yard do
14
22
  Rake::Task['docs:gen'].invoke
15
23
  end
@@ -23,7 +31,118 @@ task :travis do
23
31
  Rake::Task['spec'].invoke
24
32
  end
25
33
 
34
+ module HarnessOptions
35
+ defaults = {
36
+ :tests => ['tests'],
37
+ :log_level => 'debug',
38
+ :preserve_hosts => 'onfail',
39
+ }
40
+
41
+ DEFAULTS = defaults
42
+
43
+ def self.get_options(file_path)
44
+ puts "Attempting to merge config file: #{file_path}"
45
+ if File.exists? file_path
46
+ options = eval(File.read(file_path), binding)
47
+ else
48
+ puts "No options file found at #{File.expand_path(file_path)}... skipping"
49
+ end
50
+ options || {}
51
+ end
52
+
53
+ def self.get_mode_options(mode)
54
+ get_options("./acceptance/config/#{mode}/acceptance-options.rb")
55
+ end
56
+
57
+ def self.get_local_options
58
+ get_options('./acceptance/local_options.rb')
59
+ end
60
+
61
+ def self.final_options(mode, intermediary_options = {})
62
+ mode_options = get_mode_options(mode)
63
+ local_overrides = get_local_options
64
+ final_options = DEFAULTS.merge(mode_options)
65
+ final_options.merge!(intermediary_options)
66
+ final_options.merge!(local_overrides)
67
+ end
68
+
69
+ end
70
+
71
+ def hosts_file_env
72
+ ENV['BEAKER_HOSTS']
73
+ end
74
+
75
+ def hosts_opt(use_preserved_hosts=false)
76
+ if use_preserved_hosts
77
+ "--hosts=#{HOSTS_PRESERVED}"
78
+ else
79
+ if hosts_file_env
80
+ "--hosts=#{hosts_file_env}"
81
+ else
82
+ "--hosts=tmp/#{HOSTS_FILE}"
83
+ end
84
+ end
85
+ end
86
+
87
+ def agent_target
88
+ ENV['TEST_TARGET'] || 'redhat7-64af'
89
+ end
90
+
91
+ def master_target
92
+ ENV['MASTER_TEST_TARGET'] || 'redhat7-64default.mdcal'
93
+ end
94
+
95
+ def test_targets
96
+ ENV['LAYOUT'] || "#{master_target}-#{agent_target}"
97
+ end
98
+
99
+ HOSTS_FILE = "#{test_targets}-#{SecureRandom.uuid}.yaml"
100
+
101
+ def beaker_test(mode = :base, options = {})
102
+
103
+ preserved_hosts_mode = options[:hosts] == HOSTS_PRESERVED
104
+ final_options = HarnessOptions.final_options(mode, options)
105
+
106
+ options_opt = ""
107
+ # preserved hosts can not be used with an options file (BKR-670)
108
+ # one can still use OPTIONS
109
+
110
+ if !preserved_hosts_mode
111
+ options_file = 'merged_options.rb'
112
+ options_opt = "--options-file=#{options_file}"
113
+ File.open(options_file, 'w') do |merged|
114
+ merged.puts <<-EOS
115
+ # Copy this file to local_options.rb and adjust as needed if you wish to run
116
+ # with some local overrides.
117
+ EOS
118
+ merged.puts(final_options)
119
+ end
120
+ end
121
+
122
+ tests = ENV['TESTS'] || ENV['TEST']
123
+ tests_opt = ""
124
+ tests_opt = "--tests=#{tests}" if tests
125
+
126
+ overriding_options = ENV['OPTIONS'].to_s
127
+
128
+ args = [options_opt, hosts_opt(preserved_hosts_mode), tests_opt,
129
+ *overriding_options.split(' ')].compact
130
+
131
+ sh("beaker", *args)
132
+ end
133
+
134
+
26
135
  namespace :test do
136
+ USAGE = <<-EOS
137
+ You may set BEAKER_HOSTS=config/nodes/foo.yaml or include it in an acceptance-options.rb for Beaker,
138
+ or specify TEST_TARGET in a form beaker-hostgenerator accepts, e.g. ubuntu1504-64a.
139
+ You may override the default master test target by specifying MASTER_TEST_TARGET.
140
+ You may set TESTS=path/to/test,and/more/tests.
141
+ You may set additional Beaker OPTIONS='--more --options'
142
+ If there is a Beaker options hash in a ./acceptance/local_options.rb, it will be included.
143
+ Commandline options set through the above environment variables will override settings in this file.
144
+ EOS
145
+
27
146
  desc 'Run specs and check for deprecation warnings'
28
147
  task :spec do
29
148
  original_dir = Dir.pwd
@@ -48,8 +167,69 @@ namespace :test do
48
167
  end
49
168
  Dir.chdir( original_dir )
50
169
  end
170
+
171
+ desc <<-EOS
172
+ Run the base beaker acceptance tests
173
+ #{USAGE}
174
+ EOS
175
+ task :base => 'gen_hosts' do
176
+ beaker_test(:base)
177
+ end
178
+
179
+ desc <<-EOS
180
+ Run the hypervisor beaker acceptance tests
181
+ #{USAGE}
182
+ EOS
183
+ task :hypervisor => 'gen_hosts' do
184
+ beaker_test(:hypervisor)
185
+ end
186
+
187
+ desc <<-EOS
188
+ Run the puppet beaker acceptance tests on a pe install.
189
+ #{USAGE}
190
+ EOS
191
+ task :puppetpe => 'gen_hosts' do
192
+ beaker_test(:puppetpe)
193
+ end
194
+
195
+ desc <<-EOS
196
+ Run the puppet beaker acceptance tests on a puppet gem install.
197
+ #{USAGE}
198
+ EOS
199
+ task :puppetgem => 'gen_hosts' do
200
+ beaker_test(:puppetgem)
201
+ end
202
+
203
+ desc <<-EOS
204
+ Run the puppet beaker acceptance tests on a puppet git install.
205
+ #{USAGE}
206
+ EOS
207
+ task :puppetgit => 'gen_hosts' do
208
+ beaker_test(:puppetgit)
209
+ end
210
+
211
+ desc <<-EOS
212
+ Run the puppet beaker acceptance tests on a puppet package install.
213
+ #{USAGE}
214
+ EOS
215
+ task :puppetpkg => 'gen_hosts' do
216
+ beaker_test(:puppetpkg)
217
+ end
218
+
219
+ desc 'Generate Beaker Host Config File'
220
+ task :gen_hosts do
221
+ if hosts_file_env
222
+ next
223
+ end
224
+ cli = BeakerHostGenerator::CLI.new([test_targets])
225
+ FileUtils.mkdir_p('tmp') # -p ignores when dir already exists
226
+ File.open("tmp/#{HOSTS_FILE}", 'w') do |fh|
227
+ fh.print(cli.execute)
228
+ end
229
+ end
51
230
  end
52
231
 
232
+
53
233
  ###########################################################
54
234
  #
55
235
  # History Tasks
@@ -0,0 +1,3 @@
1
+ {
2
+ :tests => 'acceptance/tests/base'
3
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -0,0 +1,3 @@
1
+ {
2
+ :tests => 'acceptance/tests/hypervisor'
3
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -0,0 +1,4 @@
1
+ {
2
+ :pre_suite => 'acceptance/pre_suite/puppet_gem/install.rb',
3
+ :tests => 'acceptance/tests/puppet'
4
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -0,0 +1,4 @@
1
+ {
2
+ :pre_suite => 'acceptance/pre_suite/puppet_git/install.rb',
3
+ :tests => 'acceptance/tests/puppet'
4
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -0,0 +1,5 @@
1
+ {
2
+ :pre_suite => 'acceptance/pre_suite/pe/install.rb',
3
+ :tests => 'acceptance/tests/puppet',
4
+ :pe_dir => 'http://neptune.puppetlabs.lan/archives/releases/3.7.2'
5
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -0,0 +1,4 @@
1
+ {
2
+ :pre_suite => 'acceptance/pre_suite/puppet_pkg/install.rb',
3
+ :tests => 'acceptance/tests/puppet'
4
+ }.merge(eval File.read('acceptance/config/acceptance-options.rb'))
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency 'rake', '~> 10.1'
25
25
  s.add_development_dependency 'simplecov'
26
26
  s.add_development_dependency 'pry', '~> 0.10'
27
+ s.add_development_dependency 'beaker-hostgenerator'
27
28
 
28
29
  # Documentation dependencies
29
30
  s.add_development_dependency 'yard'
@@ -4,5 +4,7 @@ by Beaker.
4
4
 
5
5
  | Name | Description | Docs |
6
6
  |:-------------------|:--------------------------------------------------------------------|:----------------------------------------------------------------|
7
- | Master Manipulator | A Beaker library for changing configuration on a Puppet Master | [Github Repo](https://github.com/puppetlabs/master_manipulator) |
8
- | beaker_windows | A Beaker library that provides helpers for testing on Windows hosts | [Github Repo](https://github.com/puppetlabs/beaker_windows) |
7
+ | Master Manipulator | Easy DSL extension for changing configuration on a Puppet Master | [Github Repo](https://github.com/puppetlabs/master_manipulator) |
8
+ | beaker_windows | Useful helpers for testing on Windows hosts | [Github Repo](https://github.com/puppetlabs/beaker_windows) |
9
+ | Puppet Install Helper | Use environment variables for choosing which puppet version to install | [Github Repo](https://github.com/puppetlabs/beaker-puppet_install_helper) |
10
+ | testmode_switcher | [prototype] run your puppet module tests in master/agent, apply or local mode | [Github Repo](https://github.com/puppetlabs/beaker-testmode_switcher) |
@@ -10,7 +10,8 @@ module Beaker
10
10
  "wheezy" => "7",
11
11
  "squeeze" => "6",
12
12
  },
13
- :ubuntu => { "wily" => "1510",
13
+ :ubuntu => { "xenial" => "1604",
14
+ "wily" => "1510",
14
15
  "vivid" => "1504",
15
16
  "utopic" => "1410",
16
17
  "trusty" => "1404",
@@ -182,7 +182,7 @@ module Beaker
182
182
  suite['tests'] = test_count
183
183
  suite['errors'] = errored_tests
184
184
  suite['failures'] = failed_tests
185
- suite['skip'] = skipped_tests
185
+ suite['skipped'] = skipped_tests
186
186
  suite['pending'] = pending_tests
187
187
  suite['total'] = @total_tests
188
188
  suite['time'] = "%f" % (stop_time - start_time)
@@ -218,7 +218,7 @@ module Beaker
218
218
  end
219
219
 
220
220
  if test.test_status == :skip
221
- status = Nokogiri::XML::Node.new('skip', doc)
221
+ status = Nokogiri::XML::Node.new('skipped', doc)
222
222
  status['type'] = test.test_status.to_s
223
223
  item.add_child(status)
224
224
  end
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '2.38.1'
3
+ STRING = '2.39.0'
4
4
  end
5
5
  end
@@ -77,6 +77,11 @@ module Beaker
77
77
  expect( platform.with_version_codename ).to be === 'debian-squeeze-xxx'
78
78
  end
79
79
 
80
+ it "can convert unbuntu-1604-xxx to ubuntu-xenial-xxx" do
81
+ @name = 'ubuntu-1604-xxx'
82
+ expect( platform.with_version_codename ).to be === 'ubuntu-xenial-xxx'
83
+
84
+ end
80
85
  it "can convert ubuntu-1310-xxx to ubuntu-saucy-xxx" do
81
86
  @name = 'ubuntu-1310-xxx'
82
87
  expect( platform.with_version_codename ).to be === 'ubuntu-saucy-xxx'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.38.1
4
+ version: 2.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: beaker-hostgenerator
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: yard
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -456,6 +470,12 @@ files:
456
470
  - README.md
457
471
  - Rakefile
458
472
  - acceptance/config/acceptance-options.rb
473
+ - acceptance/config/base/acceptance-options.rb
474
+ - acceptance/config/hypervisor/acceptance-options.rb
475
+ - acceptance/config/puppetgem/acceptance-options.rb
476
+ - acceptance/config/puppetgit/acceptance-options.rb
477
+ - acceptance/config/puppetpe/acceptance-options.rb
478
+ - acceptance/config/puppetpkg/acceptance-options.rb
459
479
  - acceptance/fixtures/README.md
460
480
  - acceptance/fixtures/files/failing_shell_script.txt
461
481
  - acceptance/fixtures/files/retry_script.txt