beaker 5.0.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a779fedc9b7695d5a76a9731765e8ed5c5b8f9f1945563c2108cd0d0e01f564a
4
- data.tar.gz: d5613d1aa5a289aff25f948229f5d8c89bec28fa25ec6ae310f446e95dd44363
3
+ metadata.gz: d16043faca3a48ef9dd5a7171bf0241dd30fd801029eba8e881fe9d3d8afbef1
4
+ data.tar.gz: 64bec8b91441d824ad87a112914a5f41b5fe2b48131b9f6d99599b201279b4a3
5
5
  SHA512:
6
- metadata.gz: 33dae1fd1af4921f1fd3f00e18413a1a823749444fbed1c1fae0ed967cf055988a31692ceba29d5535bba8b1283f0b6ec0535cf21b589ecfc9f55c0d6498f51b
7
- data.tar.gz: 8ccefb72d40022e47506fdd6ab8307318fbcd3eb736f89f965368de923e65b52e14a3faac8ea4afcb7aad3d3c80e059a9ce665578d18f32c01ff073675b75387
6
+ metadata.gz: 17f0baf5a669e5ffa2e9f4214dbeb84f0e5fbf4ff80e048243215006aa8e5fc91be5df24e1714f71962a7a1d2e3d4f83c74c987f98a9a8ceff2b9397762b5167
7
+ data.tar.gz: 2826c21940af588185545f7a4f987600a789a9c646b9fe0d31d9e6d6f4f5eae0573d51591de0943d0dc9077cb0e0f3114291881fc10c6dcd3b54af24ec2425e2
data/.rubocop.yml CHANGED
@@ -1,32 +1,9 @@
1
1
  ---
2
- inherit_from: .rubocop_todo.yml
2
+ inherit_from:
3
+ - .rubocop_todo.yml
3
4
 
4
- require:
5
- - rubocop-performance
6
- - rubocop-rake
7
- - rubocop-rspec
8
-
9
- AllCops:
10
- TargetRubyVersion: 2.7
11
- NewCops: enable
12
-
13
- Gemspec/RequireMFA:
14
- Enabled: false
15
-
16
- Gemspec/DevelopmentDependencies:
17
- Enabled: false
18
-
19
- Style/TrailingCommaInHashLiteral:
20
- Enabled: True
21
- EnforcedStyleForMultiline: consistent_comma
22
-
23
- Style/TrailingCommaInArrayLiteral:
24
- Enabled: True
25
- EnforcedStyleForMultiline: consistent_comma
26
-
27
- Style/TrailingCommaInArguments:
28
- Enabled: True
29
- EnforcedStyleForMultiline: comma
5
+ inherit_gem:
6
+ voxpupuli-rubocop: rubocop.yml
30
7
 
31
8
  Layout/LineLength:
32
9
  Exclude:
@@ -65,11 +42,11 @@ RSpec/StubbedMock:
65
42
  RSpec/MultipleExpectations:
66
43
  Enabled: false
67
44
 
45
+ RSpec/IndexedLet:
46
+ Enabled: false
47
+
68
48
  RSpec/NestedGroups:
69
49
  Max: 4
70
50
 
71
- Metrics:
72
- Enabled: false
73
-
74
51
  Style:
75
52
  Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
3
- # using RuboCop version 1.48.0.
3
+ # using RuboCop version 1.50.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -236,4 +236,4 @@ Security/Open:
236
236
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
237
237
  # URISchemes: http, https
238
238
  Layout/LineLength:
239
- Max: 226
239
+ Max: 225
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.2.0](https://github.com/voxpupuli/beaker/tree/5.2.0) (2023-04-28)
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Enhance documentation about roles [\#1800](https://github.com/voxpupuli/beaker/pull/1800) ([rwaffen](https://github.com/rwaffen))
8
+ - Declare API interface on Beaker::Host [\#1806](https://github.com/voxpupuli/beaker/pull/1806) ([ekohl](https://github.com/ekohl))
9
+ - Support an extension to tmpfile [\#1735](https://github.com/voxpupuli/beaker/pull/1735) ([ekohl](https://github.com/ekohl))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Use systemctl to restat SSH on EL9 [\#1808](https://github.com/voxpupuli/beaker/pull/1808) ([ekohl](https://github.com/ekohl))
14
+
15
+ **Merged changes:**
16
+
17
+ - Drop legacy yard tasks [\#1805](https://github.com/voxpupuli/beaker/pull/1805) ([bastelfreak](https://github.com/bastelfreak))
18
+ - Switch to voxpupuli-rubocop [\#1804](https://github.com/voxpupuli/beaker/pull/1804) ([bastelfreak](https://github.com/bastelfreak))
19
+ - Disable RSpec/IndexedLet [\#1807](https://github.com/voxpupuli/beaker/pull/1807) ([ekohl](https://github.com/ekohl))
20
+
21
+ ## [5.1.0](https://github.com/voxpupuli/beaker/tree/5.1.0) (2023-03-27)
22
+
23
+ **Implemented enhancements:**
24
+
25
+ - Introduce shareable rubocop config [\#1795](https://github.com/voxpupuli/beaker/pull/1795) ([bastelfreak](https://github.com/bastelfreak))
26
+
3
27
  ## [5.0.0](https://github.com/voxpupuli/beaker/tree/5.0.0) (2023-03-24)
4
28
 
5
29
  **Breaking changes:**
data/Gemfile CHANGED
@@ -25,13 +25,6 @@ if ENV['BEAKER_HYPERVISOR']
25
25
  gem "beaker-#{ENV['BEAKER_HYPERVISOR'].split('_').first}"
26
26
  end
27
27
 
28
- group :rubocop do
29
- gem 'rubocop', '~> 1.48.0'
30
- gem 'rubocop-performance', '~> 1.16.0'
31
- gem 'rubocop-rake', '~> 0.6.0'
32
- gem 'rubocop-rspec', '~> 2.19.0'
33
- end
34
-
35
28
  group :release do
36
29
  gem 'github_changelog_generator', require: false
37
30
  end
data/Rakefile CHANGED
@@ -16,14 +16,6 @@ end
16
16
 
17
17
  task :acceptance => ['test:base', 'test:hypervisor']
18
18
 
19
- task :yard do
20
- Rake::Task['docs:gen'].invoke
21
- end
22
-
23
- task :history do
24
- Rake::Task['history:gen'].invoke
25
- end
26
-
27
19
  module HarnessOptions
28
20
  defaults = {
29
21
  :tests => ['tests'],
@@ -189,120 +181,6 @@ namespace :test do
189
181
  end
190
182
  end
191
183
 
192
- ###########################################################
193
- #
194
- # History Tasks
195
- #
196
- ###########################################################
197
- namespace :history do
198
- desc 'Generate HISTORY.md'
199
- task :gen do
200
- Dir.chdir(__dir__) do
201
- output = `bundle exec ruby history.rb .`
202
- puts output
203
- raise "History generation failed" if !output.include?('success')
204
- end
205
- end
206
- end
207
-
208
- ###########################################################
209
- #
210
- # Documentation Tasks
211
- #
212
- ###########################################################
213
- DOCS_DIR = 'yard_docs'
214
- DOCS_DAEMON = "yard server --reload --daemon --docroot #{DOCS_DIR}"
215
- FOREGROUND_SERVER = "bundle exec yard server --reload --verbose lib/beaker --docroot #{DOCS_DIR}"
216
-
217
- def running?(cmdline)
218
- ps = `ps -ef`
219
- found = ps.lines.grep(/#{Regexp.quote(cmdline)}/)
220
- raise StandardError, "Found multiple YARD Servers. Don't know what to do." if found.length > 1
221
-
222
- yes = found.empty? ? false : true
223
- return yes, found.first
224
- end
225
-
226
- def pid_from(output)
227
- output.squeeze(' ').strip.split(' ')[1]
228
- end
229
-
230
- desc 'Start the documentation server in the foreground'
231
- task :docs => 'docs:clear' do
232
- Dir.chdir(__dir__) do
233
- sh FOREGROUND_SERVER
234
- end
235
- end
236
-
237
- namespace :docs do
238
- desc 'Clear the generated documentation cache'
239
- task :clear do
240
- Dir.chdir(__dir__) do
241
- sh "rm -rf #{DOCS_DIR}"
242
- end
243
- end
244
-
245
- desc 'Generate static documentation'
246
- task :gen => 'docs:clear' do
247
- Dir.chdir(__dir__) do
248
- output = `bundle exec yard doc -o #{DOCS_DIR}`
249
- puts output
250
- fail "Errors/Warnings during yard documentation generation" if /\[warn\]|\[error\]/.match?(output)
251
- end
252
- end
253
-
254
- desc 'Run the documentation server in the background, alias `bg`'
255
- task :background => 'docs:clear' do
256
- yes, output = running?(DOCS_DAEMON)
257
- if yes
258
- puts "Not starting a new YARD Server..."
259
- puts "Found one running with pid #{pid_from(output)}."
260
- else
261
- Dir.chdir(__dir__) do
262
- sh "bundle exec #{DOCS_DAEMON}"
263
- end
264
- end
265
- end
266
-
267
- task(:bg) { Rake::Task['docs:background'].invoke }
268
-
269
- desc 'Check the status of the documentation server'
270
- task :status do
271
- yes, output = running?(DOCS_DAEMON)
272
- if yes
273
- pid = pid_from(output)
274
- puts "Found a YARD Server running with pid #{pid}"
275
- else
276
- puts "Could not find a running YARD Server."
277
- end
278
- end
279
-
280
- desc "Stop a running YARD Server"
281
- task :stop do
282
- yes, output = running?(DOCS_DAEMON)
283
- if yes
284
- pid = pid_from(output)
285
- puts "Found a YARD Server running with pid #{pid}"
286
- `kill #{pid}`
287
- puts "Stopping..."
288
- yes, _output = running?(DOCS_DAEMON)
289
- if yes
290
- `kill -9 #{pid}`
291
- yes, _output = running?(DOCS_DAEMON)
292
- if yes
293
- puts "Could not Stop Server!"
294
- else
295
- puts "Server stopped."
296
- end
297
- else
298
- puts "Server stopped."
299
- end
300
- else
301
- puts "Could not find a running YARD Server"
302
- end
303
- end
304
- end
305
-
306
184
  begin
307
185
  require 'rubygems'
308
186
  require 'github_changelog_generator/task'
data/beaker.gemspec CHANGED
@@ -22,9 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'fakefs', '~> 2.4'
23
23
  s.add_development_dependency 'rake', '~> 13.0'
24
24
  s.add_development_dependency 'rspec', '~> 3.0'
25
-
26
- # Documentation dependencies
27
- s.add_development_dependency 'yard', '~> 0.9.11'
25
+ s.add_development_dependency 'voxpupuli-rubocop', '~> 1.1'
28
26
 
29
27
  # Run time dependencies
30
28
  s.add_runtime_dependency 'minitar', '~> 0.6'
@@ -45,6 +45,7 @@ To properly define a host you must provide:
45
45
 
46
46
  * name: The string identifying this host.
47
47
  * platform: One of the Beaker supported platforms.
48
+ * roles: In a multi-host setup roles are mandatory. One host needs the role of `default`. Roles describe the 'job' of a host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
48
49
 
49
50
  ## Optional Host Settings
50
51
 
@@ -54,7 +55,7 @@ Additionally, Beaker supports the following host options:
54
55
  * hypervisor: One of `docker`, `solaris`, `ec2`, `vsphere`, `fusion`, `aix`, `vcloud` or `vagrant`.
55
56
  * Additional settings may be required depending on the selected hypervisor (ie, template, box, box_url, etc). Check the documentation below for your hypervisor for details.
56
57
  * snapshot: The name of the snapshot to revert to before testing.
57
- * roles: The 'job' of this host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
58
+ * roles: In a single-host setup roles are optional. Roles describe the 'job' of a host, an array of `master`, `agent`, `frictionless`, `dashboard`, `database`, `default` or any user-defined string.
58
59
  * pe_dir: The directory where PE builds are located, may be local directory or a URL.
59
60
  * pe_ver: The version number of PE to install.
60
61
  * vagrant_memsize: The memory size (in MB) for this host
@@ -1,8 +1,8 @@
1
1
  module Aix::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("rndnum=${RANDOM} && touch /tmp/#{name}.${rndnum} && echo /tmp/#{name}.${rndnum}")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("rndnum=${RANDOM} && touch /tmp/#{name}.${rndnum}#{extension} && echo /tmp/#{name}.${rndnum}#{extension}")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
@@ -16,7 +16,7 @@ module FreeBSD::Pkg
16
16
  execute("/bin/sh -c '#{check_pkgng_sh}'", opts) { |r| r }.exit_code == 0
17
17
  end
18
18
 
19
- def install_package(package, cmdline_args = nil, opts = {})
19
+ def install_package(package, cmdline_args = nil, _version = nil, opts = {})
20
20
  cmd = if pkgng_active?
21
21
  "pkg install #{cmdline_args || '-y'} #{package}"
22
22
  else
@@ -1,7 +1,13 @@
1
1
  module PSWindows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(_name = '')
4
+ def tmpfile(_name = '', extension = nil)
5
+ if extension
6
+ # TODO: I do not have access to Windows, but the internet suggests this
7
+ # $newname = [System.IO.Path]::ChangeExtension($filename, "#{extension}") ; MoveItem $filename $newname
8
+ raise NotImplementedError, 'Passing an extension is not implemented'
9
+ end
10
+
5
11
  result = exec(powershell('[System.IO.Path]::GetTempFileName()'))
6
12
  result.stdout.chomp
7
13
  end
@@ -280,7 +280,7 @@ module Unix::Exec
280
280
  case self['platform']
281
281
  when /debian|ubuntu|cumulus|huaweios/
282
282
  exec(Beaker::Command.new("service ssh restart"))
283
- when /el-7|centos-7|redhat-7|oracle-7|scientific-7|eos-7|el-8|centos-8|redhat-8|oracle-8|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
283
+ when /(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/
284
284
  exec(Beaker::Command.new("systemctl restart sshd.service"))
285
285
  when /el-|centos|fedora|redhat|oracle|scientific|eos/
286
286
  exec(Beaker::Command.new("/sbin/service sshd restart"))
@@ -1,8 +1,8 @@
1
1
  module Unix::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("mktemp -t #{name}.XXXXXX")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("mktemp -t #{name}.XXXXXX#{extension}")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
@@ -1,8 +1,8 @@
1
1
  module Windows::File
2
2
  include Beaker::CommandFactory
3
3
 
4
- def tmpfile(name = '')
5
- execute("cygpath -m $(mktemp -t #{name}.XXXXXX)")
4
+ def tmpfile(name = '', extension = nil)
5
+ execute("cygpath -m $(mktemp -t #{name}.XXXXXX#{extension})")
6
6
  end
7
7
 
8
8
  def tmpdir(name = '')
data/lib/beaker/host.rb CHANGED
@@ -547,6 +547,30 @@ module Beaker
547
547
 
548
548
  raise Beaker::Host::CommandFailure, result.error
549
549
  end
550
+
551
+ def tmpfile(name = '')
552
+ raise NotImplementedError
553
+ end
554
+
555
+ def tmpdir(name = '')
556
+ raise NotImplementedError
557
+ end
558
+
559
+ def path_split(paths)
560
+ raise NotImplementedError
561
+ end
562
+
563
+ def rm_rf(path)
564
+ raise NotImplementedError
565
+ end
566
+
567
+ def install_package(package, cmdline_args = nil, _version = nil, opts = {})
568
+ raise NotImplementedError
569
+ end
570
+
571
+ def add_env_var(key, val)
572
+ raise NotImplementedError
573
+ end
550
574
  end
551
575
 
552
576
  %w[
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '5.0.0'
3
+ STRING = '5.2.0'
4
4
  end
5
5
  end
data/rubocop.yml ADDED
@@ -0,0 +1,39 @@
1
+ ---
2
+ # this file is the base rubocop config for beaker + all beaker plugins
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+
8
+ AllCops:
9
+ NewCops: enable
10
+ DisplayCopNames: true
11
+ ExtraDetails: true
12
+ DisplayStyleGuide: true
13
+ TargetRubyVersion: '2.7'
14
+ Exclude:
15
+ - vendor/**/*
16
+ - .vendor/**/*
17
+
18
+ # this currently doesn't work with the way we handle our secrets
19
+ Gemspec/RequireMFA:
20
+ Enabled: false
21
+
22
+ # current Vox Pupuli default is to use `add_development_dependency` in the gemspec
23
+ Gemspec/DevelopmentDependencies:
24
+ Enabled: false
25
+
26
+ Style/TrailingCommaInHashLiteral:
27
+ Enabled: True
28
+ EnforcedStyleForMultiline: consistent_comma
29
+
30
+ Style/TrailingCommaInArrayLiteral:
31
+ Enabled: True
32
+ EnforcedStyleForMultiline: consistent_comma
33
+
34
+ Style/TrailingCommaInArguments:
35
+ Enabled: True
36
+ EnforcedStyleForMultiline: comma
37
+
38
+ Metrics:
39
+ Enabled: false
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: 5.0.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-24 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: yard
56
+ name: voxpupuli-rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.11
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.11
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitar
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -535,6 +535,7 @@ files:
535
535
  - lib/beaker/test_suite.rb
536
536
  - lib/beaker/test_suite_result.rb
537
537
  - lib/beaker/version.rb
538
+ - rubocop.yml
538
539
  - spec/beaker/cli_spec.rb
539
540
  - spec/beaker/command_spec.rb
540
541
  - spec/beaker/dsl/assertions_spec.rb