beaker 5.6.0 → 5.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -14
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +4 -3
- data/.rubocop_todo.yml +58 -5
- data/CHANGELOG.md +22 -0
- data/acceptance/tests/base/dsl/helpers/host_helpers/on_test.rb +1 -1
- data/acceptance/tests/base/dsl/platform_tag_confiner_test.rb +2 -2
- data/beaker.gemspec +1 -1
- data/docs/concepts/argument_processing_and_precedence.md +1 -1
- data/lib/beaker/host/unix/file.rb +1 -1
- data/lib/beaker/host_prebuilt_steps.rb +4 -7
- data/lib/beaker/options/command_line_parser.rb +1 -1
- data/lib/beaker/platform.rb +2 -1
- data/lib/beaker/shared/host_manager.rb +4 -4
- data/lib/beaker/ssh_connection.rb +2 -2
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/cli_spec.rb +11 -11
- data/spec/beaker/command_spec.rb +10 -10
- data/spec/beaker/dsl/helpers/host_helpers_spec.rb +11 -11
- data/spec/beaker/dsl/roles_spec.rb +15 -15
- data/spec/beaker/dsl/structure_spec.rb +3 -3
- data/spec/beaker/host/pswindows/exec_spec.rb +3 -3
- data/spec/beaker/host/unix/exec_spec.rb +3 -3
- data/spec/beaker/host/unix/file_spec.rb +8 -0
- data/spec/beaker/host/unix/pkg_spec.rb +10 -10
- data/spec/beaker/host_spec.rb +6 -6
- data/spec/beaker/logger_spec.rb +7 -7
- data/spec/beaker/options/hosts_file_parser_spec.rb +1 -1
- data/spec/beaker/options/parser_spec.rb +40 -40
- data/spec/beaker/platform_spec.rb +5 -0
- data/spec/beaker/shared/host_manager_spec.rb +1 -1
- data/spec/beaker/shared/semvar_spec.rb +1 -1
- data/spec/beaker/subcommand/subcommand_util_spec.rb +5 -5
- data/spec/beaker/test_suite_spec.rb +12 -12
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d061888ee1343b5c49408cace97d3dc345b83ebc501a3d58e8401a71e8ae122
|
4
|
+
data.tar.gz: 03d81cdbcc7cb64fd69d8f6458bb71e50f74f0529b0c2537eaf5dc1cd38f6d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35354795689469b1b0a8cfad0069aa076adcfd40115f3ac8304ec9b061978a65002ee5fb276dcbd1d19bc6afc1bebfa3b56cb13765e6ccd46d2a156e9be45ee4
|
7
|
+
data.tar.gz: 769e7d16b9c04f07beb4c8e865905d6d6154d83de538544e4e2deaad46bf57458f947f563178784c00e7a1d993408c17dba9bfdaf197eb9fb58a7c13d141ebc4
|
data/.github/dependabot.yml
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
version: 2
|
2
2
|
updates:
|
3
|
-
# raise PRs for gem updates
|
4
|
-
- package-ecosystem: bundler
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
# raise PRs for gem updates
|
4
|
+
- package-ecosystem: bundler
|
5
|
+
directory: "/"
|
6
|
+
schedule:
|
7
|
+
interval: daily
|
8
|
+
time: "13:00"
|
9
|
+
open-pull-requests-limit: 10
|
10
10
|
|
11
|
-
# Maintain dependencies for GitHub Actions
|
12
|
-
- package-ecosystem: github-actions
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
# Maintain dependencies for GitHub Actions
|
12
|
+
- package-ecosystem: github-actions
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: daily
|
16
|
+
time: "13:00"
|
17
|
+
open-pull-requests-limit: 10
|
@@ -10,11 +10,11 @@ jobs:
|
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
if: github.repository_owner == 'voxpupuli'
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v4
|
14
14
|
- name: Install Ruby 3.0
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
|
-
ruby-version: '3.
|
17
|
+
ruby-version: '3.3'
|
18
18
|
env:
|
19
19
|
BUNDLE_WITHOUT: release:development:rubocop
|
20
20
|
- name: Build gem
|
data/.github/workflows/test.yml
CHANGED
@@ -12,11 +12,11 @@ jobs:
|
|
12
12
|
BUNDLE_WITHOUT: release
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
steps:
|
15
|
-
- uses: actions/checkout@
|
15
|
+
- uses: actions/checkout@v4
|
16
16
|
- name: Install Ruby ${{ matrix.ruby }}
|
17
17
|
uses: ruby/setup-ruby@v1
|
18
18
|
with:
|
19
|
-
ruby-version: "3.
|
19
|
+
ruby-version: "3.3"
|
20
20
|
bundler-cache: true
|
21
21
|
- name: Run Rubocop
|
22
22
|
run: bundle exec rake rubocop
|
@@ -32,13 +32,14 @@ jobs:
|
|
32
32
|
- ruby: "3.0"
|
33
33
|
- ruby: "3.1"
|
34
34
|
- ruby: "3.2"
|
35
|
+
- ruby: "3.3"
|
35
36
|
coverage: "yes"
|
36
37
|
env:
|
37
38
|
COVERAGE: ${{ matrix.coverage }}
|
38
39
|
BUNDLE_WITHOUT: release:rubocop
|
39
40
|
BEAKER_HYPERVISOR: docker
|
40
41
|
steps:
|
41
|
-
- uses: actions/checkout@
|
42
|
+
- uses: actions/checkout@v4
|
42
43
|
- name: Install Ruby ${{ matrix.ruby }}
|
43
44
|
uses: ruby/setup-ruby@v1
|
44
45
|
with:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2024-03-12 17:49:37 UTC using RuboCop version 1.62.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
|
@@ -61,6 +61,8 @@ Lint/ShadowingOuterLocalVariable:
|
|
61
61
|
- 'lib/beaker/perf.rb'
|
62
62
|
|
63
63
|
# Offense count: 12
|
64
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
65
|
+
# Configuration parameters: AutoCorrect.
|
64
66
|
Lint/UselessAssignment:
|
65
67
|
Exclude:
|
66
68
|
- 'acceptance/tests/base/dsl/helpers/host_helpers/curl_with_retries_test.rb'
|
@@ -107,6 +109,7 @@ Naming/HeredocDelimiterNaming:
|
|
107
109
|
- 'spec/beaker/test_case_spec.rb'
|
108
110
|
|
109
111
|
# Offense count: 2
|
112
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
110
113
|
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
111
114
|
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
112
115
|
Naming/MemoizedInstanceVariableName:
|
@@ -128,14 +131,18 @@ RSpec/AnyInstance:
|
|
128
131
|
- 'spec/beaker/host/windows/file_spec.rb'
|
129
132
|
- 'spec/beaker/subcommand_spec.rb'
|
130
133
|
|
131
|
-
# Offense count:
|
134
|
+
# Offense count: 30
|
132
135
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
133
136
|
RSpec/BeEq:
|
134
137
|
Exclude:
|
135
138
|
- 'spec/beaker/cli_spec.rb'
|
139
|
+
- 'spec/beaker/dsl/roles_spec.rb'
|
136
140
|
- 'spec/beaker/host/pswindows/file_spec.rb'
|
137
141
|
- 'spec/beaker/host/windows/exec_spec.rb'
|
138
142
|
- 'spec/beaker/host_spec.rb'
|
143
|
+
- 'spec/beaker/shared/semvar_spec.rb'
|
144
|
+
- 'spec/beaker/subcommand/subcommand_util_spec.rb'
|
145
|
+
- 'spec/beaker/test_suite_spec.rb'
|
139
146
|
|
140
147
|
# Offense count: 121
|
141
148
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
@@ -143,7 +150,13 @@ RSpec/BeEq:
|
|
143
150
|
RSpec/ContextWording:
|
144
151
|
Enabled: false
|
145
152
|
|
146
|
-
# Offense count:
|
153
|
+
# Offense count: 1
|
154
|
+
# This cop supports safe autocorrection (--autocorrect).
|
155
|
+
RSpec/Eq:
|
156
|
+
Exclude:
|
157
|
+
- 'spec/beaker/logger_spec.rb'
|
158
|
+
|
159
|
+
# Offense count: 241
|
147
160
|
# Configuration parameters: CountAsOne.
|
148
161
|
RSpec/ExampleLength:
|
149
162
|
Max: 44
|
@@ -201,7 +214,7 @@ RSpec/MultipleDescribes:
|
|
201
214
|
RSpec/MultipleMemoizedHelpers:
|
202
215
|
Max: 18
|
203
216
|
|
204
|
-
# Offense count:
|
217
|
+
# Offense count: 502
|
205
218
|
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
206
219
|
# SupportedStyles: always, named_only
|
207
220
|
RSpec/NamedSubject:
|
@@ -218,6 +231,26 @@ RSpec/NoExpectationExample:
|
|
218
231
|
- 'spec/beaker/logger_spec.rb'
|
219
232
|
- 'spec/beaker/options/subcommand_options_parser_spec.rb'
|
220
233
|
|
234
|
+
# Offense count: 1
|
235
|
+
# This cop supports safe autocorrection (--autocorrect).
|
236
|
+
RSpec/Rails/MinitestAssertions:
|
237
|
+
Exclude:
|
238
|
+
- 'spec/beaker/dsl/structure_spec.rb'
|
239
|
+
|
240
|
+
# Offense count: 60
|
241
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
242
|
+
RSpec/ReceiveMessages:
|
243
|
+
Exclude:
|
244
|
+
- 'spec/beaker/cli_spec.rb'
|
245
|
+
- 'spec/beaker/command_spec.rb'
|
246
|
+
- 'spec/beaker/host_prebuilt_steps_spec.rb'
|
247
|
+
- 'spec/beaker/host_spec.rb'
|
248
|
+
- 'spec/beaker/options/parser_spec.rb'
|
249
|
+
- 'spec/beaker/shared/error_handler_spec.rb'
|
250
|
+
- 'spec/beaker/subcommand_spec.rb'
|
251
|
+
- 'spec/beaker/test_suite_spec.rb'
|
252
|
+
- 'spec/helpers.rb'
|
253
|
+
|
221
254
|
# Offense count: 7
|
222
255
|
RSpec/RepeatedDescription:
|
223
256
|
Exclude:
|
@@ -231,6 +264,26 @@ RSpec/RepeatedExample:
|
|
231
264
|
- 'spec/beaker/dsl/roles_spec.rb'
|
232
265
|
- 'spec/beaker/logger_spec.rb'
|
233
266
|
|
267
|
+
# Offense count: 13
|
268
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
269
|
+
# Include: **/*_spec.rb
|
270
|
+
RSpec/SpecFilePathFormat:
|
271
|
+
Exclude:
|
272
|
+
- '**/spec/routing/**/*'
|
273
|
+
- 'spec/beaker/dsl/assertions_spec.rb'
|
274
|
+
- 'spec/beaker/dsl/helpers/host_helpers_spec.rb'
|
275
|
+
- 'spec/beaker/dsl/helpers/test_helpers_spec.rb'
|
276
|
+
- 'spec/beaker/dsl/helpers/web_helpers_spec.rb'
|
277
|
+
- 'spec/beaker/dsl/outcomes_spec.rb'
|
278
|
+
- 'spec/beaker/dsl/roles_spec.rb'
|
279
|
+
- 'spec/beaker/dsl/structure_spec.rb'
|
280
|
+
- 'spec/beaker/dsl/wrappers_spec.rb'
|
281
|
+
- 'spec/beaker/host/mac/group_spec.rb'
|
282
|
+
- 'spec/beaker/host/mac/user_spec.rb'
|
283
|
+
- 'spec/beaker/host/pswindows/user_spec.rb'
|
284
|
+
- 'spec/beaker/host/windows/user_spec.rb'
|
285
|
+
- 'spec/beaker/host_prebuilt_steps_spec.rb'
|
286
|
+
|
234
287
|
# Offense count: 178
|
235
288
|
RSpec/SubjectStub:
|
236
289
|
Exclude:
|
@@ -283,7 +336,7 @@ Security/Open:
|
|
283
336
|
Exclude:
|
284
337
|
- 'lib/beaker/dsl/helpers/web_helpers.rb'
|
285
338
|
|
286
|
-
# Offense count:
|
339
|
+
# Offense count: 106
|
287
340
|
# This cop supports safe autocorrection (--autocorrect).
|
288
341
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
289
342
|
# URISchemes: http, https
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [5.8.0](https://github.com/voxpupuli/beaker/tree/5.8.0) (2024-03-23)
|
4
|
+
|
5
|
+
**Implemented enhancements:**
|
6
|
+
|
7
|
+
- Add Ruby 3.3 support [\#1859](https://github.com/voxpupuli/beaker/pull/1859) ([bastelfreak](https://github.com/bastelfreak))
|
8
|
+
- Do not attempt to install curl on DNF-based distros [\#1854](https://github.com/voxpupuli/beaker/pull/1854) ([ekohl](https://github.com/ekohl))
|
9
|
+
- PE-37978: Add 'amazon' to #repo-filename method [\#1858](https://github.com/voxpupuli/beaker/pull/1858) ([span786](https://github.com/span786))
|
10
|
+
|
11
|
+
**Fixed bugs:**
|
12
|
+
|
13
|
+
- CLI: Fix typo: opton->option [\#1849](https://github.com/voxpupuli/beaker/pull/1849) ([bastelfreak](https://github.com/bastelfreak))
|
14
|
+
|
15
|
+
**Others:**
|
16
|
+
|
17
|
+
- build(deps-dev): update voxpupuli-rubocop requirement from ~> 2.4.0 to ~> 2.6.0 [\#1850](https://github.com/voxpupuli/beaker/pull/1850) (dependabot)
|
18
|
+
|
19
|
+
## [5.7.0](https://github.com/voxpupuli/beaker/tree/5.7.0) (2024-02-13)
|
20
|
+
|
21
|
+
**Implemented enhancements:**
|
22
|
+
|
23
|
+
- Add Ubuntu 24.04 noble codename [\#1847](https://github.com/voxpupuli/beaker/pull/1847) ([h0tw1r3](https://github.com/h0tw1r3))
|
24
|
+
|
3
25
|
## [5.6.0](https://github.com/voxpupuli/beaker/tree/5.6.0) (2023-11-23)
|
4
26
|
|
5
27
|
**Implemented enhancements:**
|
@@ -13,7 +13,7 @@ test_name "DSL::Structure::PlatformTagConfiner" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
step "#{pstc_method_name} can remove hosts from a test, or be skipped if empty" do
|
16
|
-
|
16
|
+
assert_operator hosts.length, :>, 0, "#{pstc_method_name} did not have enough hosts to test"
|
17
17
|
previous_hosts = hosts.dup
|
18
18
|
|
19
19
|
options[:platform_tag_confines] = [
|
@@ -35,7 +35,7 @@ test_name "DSL::Structure::PlatformTagConfiner" do
|
|
35
35
|
# is being raised confirms that a lower number of hosts are coming out of
|
36
36
|
# the confine (0) than came in (>0, according to our pre-condition assertion)
|
37
37
|
else
|
38
|
-
|
38
|
+
assert_operator hosts.length, :<, previous_hosts.length, "#{pstc_method_name} did not change hosts array"
|
39
39
|
end
|
40
40
|
|
41
41
|
# cleanup
|
data/beaker.gemspec
CHANGED
@@ -22,7 +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
|
-
s.add_development_dependency 'voxpupuli-rubocop', '~> 2.
|
25
|
+
s.add_development_dependency 'voxpupuli-rubocop', '~> 2.6.0'
|
26
26
|
|
27
27
|
# Run time dependencies
|
28
28
|
s.add_runtime_dependency 'minitar', '~> 0.6'
|
@@ -89,7 +89,7 @@ Usage: beaker [options...]
|
|
89
89
|
(default sample.cfg)
|
90
90
|
-o, --options-file FILE Read options from FILE
|
91
91
|
This should evaluate to a ruby hash.
|
92
|
-
CLI
|
92
|
+
CLI options are given precedence.
|
93
93
|
--type TYPE one of git, foss, or pe
|
94
94
|
used to determine underlying path structure of puppet install
|
95
95
|
(default pe)
|
@@ -113,7 +113,7 @@ module Unix::File
|
|
113
113
|
repo_filename = format("pl-%s-%s-", package_name, build_version)
|
114
114
|
|
115
115
|
case variant
|
116
|
-
when /fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/
|
116
|
+
when /amazon|fedora|el|redhat|centos|cisco_nexus|cisco_ios_xr|opensuse|sles/
|
117
117
|
variant = 'el' if %w[centos redhat].include?(variant)
|
118
118
|
|
119
119
|
variant = 'redhatfips' if self['packaging_platform']&.include?('redhatfips')
|
@@ -10,10 +10,9 @@ module Beaker
|
|
10
10
|
NTPSERVER = 'pool.ntp.org'
|
11
11
|
SLEEPWAIT = 5
|
12
12
|
TRIES = 5
|
13
|
-
AMAZON2023_PACKAGES = %w[
|
14
|
-
RHEL8_PACKAGES = %w[
|
15
|
-
|
16
|
-
FEDORA_PACKAGES = %w[curl chrony]
|
13
|
+
AMAZON2023_PACKAGES = %w[chrony]
|
14
|
+
RHEL8_PACKAGES = %w[chrony]
|
15
|
+
FEDORA_PACKAGES = %w[chrony]
|
17
16
|
UNIX_PACKAGES = %w[curl ntpdate]
|
18
17
|
FREEBSD_PACKAGES = ['curl', 'perl5|perl']
|
19
18
|
OPENBSD_PACKAGES = ['curl']
|
@@ -111,10 +110,8 @@ module Beaker
|
|
111
110
|
case host['platform']
|
112
111
|
when /amazon/
|
113
112
|
AMAZON2023_PACKAGES
|
114
|
-
when /el-
|
113
|
+
when /el-[89]/
|
115
114
|
RHEL8_PACKAGES
|
116
|
-
when /el-9/
|
117
|
-
RHEL9_PACKAGES
|
118
115
|
when /sles-10/
|
119
116
|
SLES10_PACKAGES
|
120
117
|
when /opensuse|sles-/
|
@@ -25,7 +25,7 @@ module Beaker
|
|
25
25
|
opts.on '-o', '--options-file FILE',
|
26
26
|
'Read options from FILE',
|
27
27
|
'This should evaluate to a ruby hash.',
|
28
|
-
'CLI
|
28
|
+
'CLI options are given precedence.' do |file|
|
29
29
|
@cmd_options[:options_file] = file
|
30
30
|
end
|
31
31
|
|
data/lib/beaker/platform.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Beaker
|
2
2
|
module Shared
|
3
3
|
# Methods for managing Hosts.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
# - selecting hosts by role (Symbol or String)
|
5
|
+
# - selecting hosts by name (String)
|
6
|
+
# - adding additional method definitions for selecting by role
|
7
|
+
# - executing blocks of code against selected sets of hosts
|
8
8
|
module HostManager
|
9
9
|
# Find hosts from a given array of hosts that all have the desired role.
|
10
10
|
# @param [Array<Host>] hosts The hosts to examine
|
@@ -104,10 +104,10 @@ module Beaker
|
|
104
104
|
# Try each method in turn until we succeed
|
105
105
|
methods = @ssh_connection_preference.dup
|
106
106
|
while (not @ssh) && (not methods.empty?)
|
107
|
-
if instance_variable_get("@#{methods[0]}").nil?
|
107
|
+
if instance_variable_get(:"@#{methods[0]}").nil?
|
108
108
|
@logger.warn "Skipping #{methods[0]} method to ssh to host as its value is not set. Refer to https://github.com/puppetlabs/beaker/tree/master/docs/how_to/ssh_connection_preference.md to remove this warning"
|
109
109
|
elsif SUPPORTED_CONNECTION_METHODS.include?(methods[0])
|
110
|
-
@ssh = connect_block(instance_variable_get("@#{methods[0]}"), @user, @ssh_opts, options)
|
110
|
+
@ssh = connect_block(instance_variable_get(:"@#{methods[0]}"), @user, @ssh_opts, options)
|
111
111
|
else
|
112
112
|
@logger.warn "Beaker does not support #{methods[0]} to SSH to host, trying next available method."
|
113
113
|
@ssh_connection_preference.delete(methods[0])
|
data/lib/beaker/version.rb
CHANGED
data/spec/beaker/cli_spec.rb
CHANGED
@@ -160,9 +160,9 @@ module Beaker
|
|
160
160
|
|
161
161
|
expect(cli).to receive(:run_suite).twice
|
162
162
|
expect { cli.execute! }.to raise_error
|
163
|
-
expect(cli.instance_variable_get(:@attribution)[:logger]).to
|
164
|
-
expect(cli.instance_variable_get(:@attribution)[:timestamp]).to
|
165
|
-
expect(cli.instance_variable_get(:@attribution)[:beaker_version]).to
|
163
|
+
expect(cli.instance_variable_get(:@attribution)[:logger]).to eq 'runtime'
|
164
|
+
expect(cli.instance_variable_get(:@attribution)[:timestamp]).to eq 'runtime'
|
165
|
+
expect(cli.instance_variable_get(:@attribution)[:beaker_version]).to eq 'runtime'
|
166
166
|
end
|
167
167
|
|
168
168
|
it 'continues testing after failed test if using slow fail_mode' do
|
@@ -362,10 +362,10 @@ module Beaker
|
|
362
362
|
|
363
363
|
preserved_file = cli.preserve_hosts_file
|
364
364
|
hosts_yaml = load_yaml_file(preserved_file)
|
365
|
-
expect(hosts_yaml['CONFIG'][:tests]).to
|
366
|
-
expect(hosts_yaml['CONFIG'][:pre_suite]).to
|
367
|
-
expect(hosts_yaml['CONFIG'][:post_suite]).to
|
368
|
-
expect(hosts_yaml['CONFIG'][:pre_cleanup]).to
|
365
|
+
expect(hosts_yaml['CONFIG'][:tests]).to eq []
|
366
|
+
expect(hosts_yaml['CONFIG'][:pre_suite]).to eq []
|
367
|
+
expect(hosts_yaml['CONFIG'][:post_suite]).to eq []
|
368
|
+
expect(hosts_yaml['CONFIG'][:pre_cleanup]).to eq []
|
369
369
|
end
|
370
370
|
end
|
371
371
|
|
@@ -541,7 +541,7 @@ module Beaker
|
|
541
541
|
command_correct = "p --log-level debug --hosts #{new_hosts_file} jam --jankies --flag-business"
|
542
542
|
|
543
543
|
answer = cli.build_hosts_preserved_reproducing_command(command_to_sub, new_hosts_file)
|
544
|
-
expect(answer).to
|
544
|
+
expect(answer).to start_with(command_correct)
|
545
545
|
end
|
546
546
|
|
547
547
|
it 'doesn\'t replace an entry if no --hosts key is found' do
|
@@ -549,7 +549,7 @@ module Beaker
|
|
549
549
|
command_correct = 'p --log-level debug johnnypantaloons7 --jankies --flag-business'
|
550
550
|
|
551
551
|
answer = cli.build_hosts_preserved_reproducing_command(command_to_sub, 'john/deer/plans.txt')
|
552
|
-
expect(answer).to
|
552
|
+
expect(answer).to start_with(command_correct)
|
553
553
|
end
|
554
554
|
|
555
555
|
it 'removes any old --provision flags' do
|
@@ -557,7 +557,7 @@ module Beaker
|
|
557
557
|
command_correct = 'jam --jankies --flag-business'
|
558
558
|
|
559
559
|
answer = cli.build_hosts_preserved_reproducing_command(command_to_sub, 'can/talk/to/pigs.yml')
|
560
|
-
expect(answer).to
|
560
|
+
expect(answer).to start_with(command_correct)
|
561
561
|
end
|
562
562
|
|
563
563
|
it 'removes any old --no-provision flags' do
|
@@ -565,7 +565,7 @@ module Beaker
|
|
565
565
|
command_correct = 'jam --jankoos --flag-businesses'
|
566
566
|
|
567
567
|
answer = cli.build_hosts_preserved_reproducing_command(command_to_sub, 'can/talk/to/bears.yml')
|
568
|
-
expect(answer).to
|
568
|
+
expect(answer).to start_with(command_correct)
|
569
569
|
end
|
570
570
|
end
|
571
571
|
end
|
data/spec/beaker/command_spec.rb
CHANGED
@@ -19,12 +19,12 @@ module Beaker
|
|
19
19
|
@args = %w[to the baz]
|
20
20
|
@options = { :foo => 'bar' }
|
21
21
|
|
22
|
-
expect(cmd.options).to
|
23
|
-
expect(cmd.args).to
|
24
|
-
expect(cmd.command).to
|
22
|
+
expect(cmd.options).to eq @options
|
23
|
+
expect(cmd.args).to eq @args
|
24
|
+
expect(cmd.command).to eq @command
|
25
25
|
|
26
|
-
expect(cmd.args_string).to
|
27
|
-
expect(cmd.options_string).to
|
26
|
+
expect(cmd.args_string).to eq 'to the baz'
|
27
|
+
expect(cmd.options_string).to eq '--foo=bar'
|
28
28
|
end
|
29
29
|
|
30
30
|
describe '#:prepend_cmds' do
|
@@ -35,7 +35,7 @@ module Beaker
|
|
35
35
|
allow(host).to receive(:prepend_commands).and_return('aloha!')
|
36
36
|
allow(host).to receive(:append_commands).and_return('')
|
37
37
|
|
38
|
-
expect(cmd.cmd_line(host)).to
|
38
|
+
expect(cmd.cmd_line(host)).to eq "aloha! /usr/bin/blah --foo=bar to the baz"
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'can handle no prepend_cmds' do
|
@@ -45,7 +45,7 @@ module Beaker
|
|
45
45
|
allow(host).to receive(:prepend_commands).and_return('')
|
46
46
|
allow(host).to receive(:append_commands).and_return('')
|
47
47
|
|
48
|
-
expect(cmd.cmd_line(host)).to
|
48
|
+
expect(cmd.cmd_line(host)).to eq "/usr/bin/blah --foo=bar to the baz"
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -57,7 +57,7 @@ module Beaker
|
|
57
57
|
allow(host).to receive(:prepend_commands).and_return('aloha!')
|
58
58
|
allow(host).to receive(:append_commands).and_return('moo cow')
|
59
59
|
|
60
|
-
expect(cmd.cmd_line(host)).to
|
60
|
+
expect(cmd.cmd_line(host)).to eq "aloha! /usr/bin/blah --foo=bar to the baz moo cow"
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'can handle no append_cmds' do
|
@@ -67,7 +67,7 @@ module Beaker
|
|
67
67
|
allow(host).to receive(:prepend_commands).and_return('')
|
68
68
|
allow(host).to receive(:append_commands).and_return('')
|
69
69
|
|
70
|
-
expect(cmd.cmd_line(host)).to
|
70
|
+
expect(cmd.cmd_line(host)).to eq "/usr/bin/blah --foo=bar to the baz"
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -85,7 +85,7 @@ module Beaker
|
|
85
85
|
describe '#args_string' do
|
86
86
|
it 'joins an array' do
|
87
87
|
subject.args = ['my/command and', nil, 'its args and opts']
|
88
|
-
expect(subject.args_string).to
|
88
|
+
expect(subject.args_string).to eq 'my/command and its args and opts'
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -87,7 +87,7 @@ describe ClassMixedWithDSLHelpers do
|
|
87
87
|
# This will only get hit if forking processes is supported and at least 2 items are being submitted to run in parallel
|
88
88
|
expect(InParallel::InParallelExecutor).to receive(:_execute_in_parallel).with(any_args).and_call_original.exactly(5).times
|
89
89
|
results = subject.on(hosts, command, { :run_in_parallel => true })
|
90
|
-
expect(results).to
|
90
|
+
expect(results).to eq expected
|
91
91
|
end
|
92
92
|
|
93
93
|
it 'delegates to itself for each host passed' do
|
@@ -99,7 +99,7 @@ describe ClassMixedWithDSLHelpers do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
results = subject.on(hosts, command)
|
102
|
-
expect(results).to
|
102
|
+
expect(results).to eq expected
|
103
103
|
end
|
104
104
|
|
105
105
|
context 'upon command completion' do
|
@@ -110,19 +110,19 @@ describe ClassMixedWithDSLHelpers do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
it 'returns the result of the action' do
|
113
|
-
expect(@res).to
|
113
|
+
expect(@res).to eq result
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'provides access to stdout' do
|
117
|
-
expect(@res.stdout).to
|
117
|
+
expect(@res.stdout).to eq 'stdout'
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'provides access to stderr' do
|
121
|
-
expect(@res.stderr).to
|
121
|
+
expect(@res.stderr).to eq 'stderr'
|
122
122
|
end
|
123
123
|
|
124
124
|
it 'provides access to exit_code' do
|
125
|
-
expect(@res.exit_code).to
|
125
|
+
expect(@res.exit_code).to eq 0
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
@@ -141,19 +141,19 @@ describe ClassMixedWithDSLHelpers do
|
|
141
141
|
|
142
142
|
it 'provides access to stdout' do
|
143
143
|
subject.on host, command do |containing_class|
|
144
|
-
expect(containing_class.stdout).to
|
144
|
+
expect(containing_class.stdout).to eq 'stdout'
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
148
|
it 'provides access to stderr' do
|
149
149
|
subject.on host, command do |containing_class|
|
150
|
-
expect(containing_class.stderr).to
|
150
|
+
expect(containing_class.stderr).to eq 'stderr'
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
154
|
it 'provides access to exit_code' do
|
155
155
|
subject.on host, command do |containing_class|
|
156
|
-
expect(containing_class.exit_code).to
|
156
|
+
expect(containing_class.exit_code).to eq 0
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
@@ -203,7 +203,7 @@ describe ClassMixedWithDSLHelpers do
|
|
203
203
|
expect { subject.retry_on(host, command, opts) }.to raise_error(RuntimeError)
|
204
204
|
end
|
205
205
|
|
206
|
-
it '
|
206
|
+
it 'returns success correctly if it succeeds the first time' do
|
207
207
|
result.stdout = 'stdout'
|
208
208
|
result.stderr = 'stderr'
|
209
209
|
result.exit_code = 0
|
@@ -220,7 +220,7 @@ describe ClassMixedWithDSLHelpers do
|
|
220
220
|
expect(result_given.exit_code).to be === 0
|
221
221
|
end
|
222
222
|
|
223
|
-
it '
|
223
|
+
it 'returns success correctly if it succeeds after failing a few times' do
|
224
224
|
result.stdout = 'stdout'
|
225
225
|
result.stderr = 'stderr'
|
226
226
|
|