beaker-rspec 6.2.0 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTA2OGVlNGU3YWNkNWMzNjc0YzkxMTVhMjU3N2E5OTJiODQ0ZTgyNg==
5
- data.tar.gz: !binary |-
6
- ODMyY2Q5NGI3YTA1YjgwNzdiYzRhODdkOWNmNjRkOTNhYjk2YzAyNw==
2
+ SHA256:
3
+ metadata.gz: 20eed9cdf4d73abdff3288faeafa0bc2fb6cdef267ac8b7c77274a36ca8879bd
4
+ data.tar.gz: 9a7c150ebed5fcaea176fdc551726be8b00f12719236e4a42edff4484c56e823
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- M2ViNmU1NThkNDUyZGQwMDg2MjZjMTUwNzVhOGI5NTM1MTc1YWRlMTNlZDJm
10
- Y2QzNzQ3OWQyZjliY2RhOTczYzE1Y2U2MzM2NDI2ZTAxMmQ0MmQ5MjM5ZGVh
11
- YmFkYjljY2JhNzMxMzZiMmM0MzI3ZTFlYjYzOTVmNGNjYTEzMzU=
12
- data.tar.gz: !binary |-
13
- NzAwZDJiMmQ1ZGFhZWFlZTFmMjZiNGIyMjRhYzk4NzNjZjUxN2YwZWUyYjBm
14
- ZmQ3NzUwYjk4MzQ5YjJlOTJmMmY1YjllY2YyNzJjYzQyY2JjMThmOWY4NzY3
15
- OWZlYzFiNGRmMGY4MGQ0OTIwYjQ1ZjA3MDg3NjYzNDMwNjI3MDg=
6
+ metadata.gz: ef5f1efa8854efc43980c6c4e72fe84f5db4f66f2dfe362e502fbd5f5b1210f23c28749d4d3649606f2eacf2e57792871ea7e4781d7162b92dd5683438e4e03e
7
+ data.tar.gz: 5eae3992b56f4d4946adffd7dd743f0254ec29a690843b6a604f4540fcde532d1d97bce8c7d2ac8553f8e096070de8859cd2305583593fe7cd3d2413972634a5
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
@@ -0,0 +1,29 @@
1
+ name: Test
2
+
3
+ on:
4
+ - pull_request
5
+
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby:
13
+ - "2.4"
14
+ - "2.5"
15
+ - "2.6"
16
+ - "2.7"
17
+ - "3.0"
18
+ env:
19
+ BUNDLE_WITHOUT: release
20
+ name: Ruby ${{ matrix.ruby }}
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Install Ruby ${{ matrix.ruby }}
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ bundler-cache: true
28
+ - name: Verify gem builds
29
+ run: bundle exec gem build beaker-rspec.gemspec
data/Gemfile CHANGED
@@ -18,5 +18,11 @@ else
18
18
  gem 'beaker'
19
19
  end
20
20
 
21
+ # For running the spec/acceptance/example_spec.rb
22
+ gem 'beaker-vagrant'
23
+
24
+ # Dependencies for CI acceptance testing; TODO: fix CI so this can be removed
25
+ gem 'beaker-hostgenerator'
26
+ gem 'beaker-vmpooler', '~> 1.3'
21
27
 
22
28
  gemspec
data/README.md CHANGED
@@ -42,7 +42,8 @@ cd .vagrant/beaker_vagrant_files/default.yml ; vagrant destroy --force
42
42
  * `BEAKER_keyfile`: specify alternate SSH key to access the test VMs
43
43
  * `BEAKER_options_file`: set to the file path of the options file to be used as the default options for beaker. Equivalent to the `--options-file` parameter.
44
44
  * `BEAKER_provision`: set to `no` to skip provisioning boxes before testing, beaker will then assume that boxes are already provisioned and reachable
45
- * `BEAKER_set`: set to the name of the node file to be used during testing (exclude .yml file extension, it will be added by beaker-rspec). The file is assumed to be in module's spec/acceptance/nodesets directory.
45
+ * `BEAKER_setdir`: change the directory with nodesets. Defaults to the module's `spec/acceptance/nodesets` directory.
46
+ * `BEAKER_set`: set to the name of the node file to be used during testing (exclude .yml file extension, it will be added by beaker-rspec). The file is assumed to be in the `setdir` (see `BEAKER_setdir`).
46
47
  * `BEAKER_setfile` - set to the full path to a node file be used during testing (be sure to include full path and file extensions, beaker-rspec will use this path without editing/altering it in any way)
47
48
 
48
49
  For details on the specific mappings, the [setup code](https://github.com/puppetlabs/beaker-rspec/blob/2771b4b1864692690254a969680a57ff22ac0516/lib/beaker-rspec/spec_helper.rb#L26-L32) and the [beaker docs](https://github.com/puppetlabs/beaker/blob/master/docs/tutorials/the_command_line.md).
@@ -73,13 +74,13 @@ Then run
73
74
 
74
75
  ## Create node files
75
76
 
76
- These files indicate the nodes (or hosts) that the tests will be run on. By default, any node file called `default.yml` will be used. You can override this using the `BEAKER_set` environment variable to indicate an alternate file. Do not provide full path or the '.yml' file extension to `BEAKER_set`, it is assumed to be located in 'spec/acceptance/nodesets/${NAME}.yml' by beaker-rspec. If you wish to use a completely different file location use `BEAKER_setfile` and set it to the full path (including file extension) of your hosts file.
77
+ These files indicate the nodes (or hosts) that the tests will be run on. By default, any node file called `default.yml` will be used. You can override this using the `BEAKER_set` environment variable to indicate an alternate file. Do not provide full path or the '.yml' file extension to `BEAKER_set`, beaker-rspec expands the filename to '${DIR}/${NAME}.yml'. The directory defaults to `spec/acceptance/nodesets` but can be overridden with the `BEAKER_setdir` variable. `BEAKER_setdir` gives full control over the path (including file extension).
77
78
 
78
79
  Nodes are pulled from [Puppet Labs Vagrant Boxes](https://vagrantcloud.com/puppetlabs).
79
80
 
80
81
  Example node files can be found here:
81
82
 
82
- * [Puppet Labs example Vagrant node files](https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/vagrant_hosts_file_examples.md)
83
+ * [Puppet Labs example Vagrant node files](https://github.com/puppetlabs/beaker-vagrant/blob/master/docs/vagrant_hosts_file_examples.md)
83
84
 
84
85
  Create the nodesets directory. From module's top level directory:
85
86
 
data/beaker-rspec.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.description = %q{RSpec bindings for beaker, see https://github.com/puppetlabs/beaker}
13
13
  s.license = 'Apache-2.0'
14
14
 
15
- s.required_ruby_version = Gem::Requirement.new('>= 2.1.8', '<3.0.0')
15
+ s.required_ruby_version = Gem::Requirement.new('>= 2.1.8', '<4.0.0')
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -21,19 +21,27 @@ Gem::Specification.new do |s|
21
21
 
22
22
  # Testing dependencies
23
23
  s.add_development_dependency 'minitest', '~> 5.4'
24
- s.add_development_dependency 'fakefs', '~> 0.6'
24
+ # pin fakefs for Ruby < 2.3
25
+ if RUBY_VERSION < "2.3"
26
+ s.add_development_dependency 'fakefs', '~> 0.6', '< 0.14'
27
+ else
28
+ s.add_development_dependency 'fakefs', '~> 0.6'
29
+ end
25
30
  s.add_development_dependency 'rake', '~> 10.1'
26
31
 
27
32
  # Documentation dependencies
28
33
  s.add_development_dependency 'yard'
29
34
  s.add_development_dependency 'thin'
30
35
 
36
+ # Dependency for example spec/acceptance tests
37
+ s.add_runtime_dependency 'beaker-pe'
38
+
31
39
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
32
40
  s.add_development_dependency 'rack', '~> 1.6'
33
41
  end
34
42
 
35
43
  # Run time dependencies
36
- s.add_runtime_dependency 'beaker', '~> 3.0'
44
+ s.add_runtime_dependency 'beaker', '> 3.0'
37
45
  s.add_runtime_dependency 'rspec', '~> 3.0'
38
46
  s.add_runtime_dependency 'serverspec', '~> 2'
39
47
  s.add_runtime_dependency 'specinfra', '~> 2'
@@ -25,6 +25,7 @@ RSpec.configure do |c|
25
25
  env_vars = {
26
26
  :color => ENV['BEAKER_color'] || ENV['RS_COLOR'],
27
27
  :nodeset => ENV['BEAKER_set'] || ENV['RS_SET'],
28
+ :nodesetdir => ENV['BEAKER_setdir'] || ENV['RS_SETDIR'],
28
29
  :nodesetfile => ENV['BEAKER_setfile'] || ENV['RS_SETFILE'],
29
30
  :provision => ENV['BEAKER_provision'] || ENV['RS_PROVISION'],
30
31
  :keyfile => ENV['BEAKER_keyfile'] || ENV['RS_KEYFILE'],
@@ -36,24 +37,34 @@ RSpec.configure do |c|
36
37
  options = defaults.merge(env_vars)
37
38
 
38
39
  # process options to construct beaker command string
39
- nodesetfile = options[:nodesetfile] || File.join('spec/acceptance/nodesets',"#{options[:nodeset]}.yml")
40
+ nodesetdir = options[:nodesetdir] || File.join('spec', 'acceptance', 'nodesets')
41
+ nodesetfile = options[:nodesetfile] || File.join(nodesetdir, "#{options[:nodeset]}.yml")
40
42
  fresh_nodes = options[:provision] == 'no' ? '--no-provision' : nil
41
43
  keyfile = options[:keyfile] ? ['--keyfile', options[:keyfile]] : nil
42
44
  debug = options[:debug] ? ['--log-level', 'debug'] : nil
43
45
  color = options[:color] == 'no' ? ['--no-color'] : nil
44
- options_file = options[:optionsfile] ? ['--options-file',options[:optionsfile]] || nil
46
+ options_file = options[:optionsfile] ? ['--options-file',options[:optionsfile]] : nil
45
47
 
46
48
  # Configure all nodes in nodeset
47
- c.setup([fresh_nodes, '--hosts', nodesetfile, keyfile, debug, color, options_file]).flatten.compact)
48
- c.provision
49
- c.validate
50
- c.configure
49
+ c.setup([fresh_nodes, '--hosts', nodesetfile, keyfile, debug, color, options_file].flatten.compact)
51
50
 
52
51
  trap "SIGINT" do
53
52
  c.cleanup
54
53
  exit!(1)
55
54
  end
56
55
 
56
+ begin
57
+ c.provision
58
+ rescue StandardError => e
59
+ logger.error(e)
60
+ logger.info(e.backtrace)
61
+ c.cleanup
62
+ exit!(1)
63
+ end
64
+
65
+ c.validate
66
+ c.configure
67
+
57
68
  # Destroy nodes if no preserve hosts
58
69
  c.after :suite do
59
70
  case options[:destroy]
@@ -1,5 +1,5 @@
1
1
  module BeakerRSpec
2
2
  module Version
3
- STRING = '6.2.0'
3
+ STRING = '6.3.0'
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ # if you need DSL extension libraries, it appears that they have to be loaded before the RSpec shim
2
+ require "beaker-pe"
3
+
1
4
  ENV['RS_SETFILE'] ||= 'sample.cfg'
2
5
 
3
6
  require "beaker-rspec"
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.4'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fakefs
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.6'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
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
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thin
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rack
84
+ name: beaker-pe
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '1.6'
90
- type: :development
89
+ version: '0'
90
+ type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '1.6'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: beaker
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - ">"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '3.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - ">"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '3.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '3.0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '3.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: serverspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '2'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '2'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: specinfra
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: '2'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ~>
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '2'
153
153
  description: RSpec bindings for beaker, see https://github.com/puppetlabs/beaker
@@ -157,8 +157,9 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
- - .gitignore
161
- - .travis.yml
160
+ - ".github/dependabot.yml"
161
+ - ".github/workflows/test.yml"
162
+ - ".gitignore"
162
163
  - Gemfile
163
164
  - HISTORY.md
164
165
  - LICENSE
@@ -183,20 +184,19 @@ require_paths:
183
184
  - lib
184
185
  required_ruby_version: !ruby/object:Gem::Requirement
185
186
  requirements:
186
- - - ! '>='
187
+ - - ">="
187
188
  - !ruby/object:Gem::Version
188
189
  version: 2.1.8
189
- - - <
190
+ - - "<"
190
191
  - !ruby/object:Gem::Version
191
- version: 3.0.0
192
+ version: 4.0.0
192
193
  required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  requirements:
194
- - - ! '>='
195
+ - - ">="
195
196
  - !ruby/object:Gem::Version
196
197
  version: '0'
197
198
  requirements: []
198
- rubyforge_project:
199
- rubygems_version: 2.4.6
199
+ rubygems_version: 3.0.8
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: RSpec bindings for beaker
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- before_install:
2
- - gem --version
3
- language: ruby
4
- script: 'bundle exec gem build beaker-rspec.gemspec'
5
- notifications:
6
- email: false
7
- rvm:
8
- - 2.1.9
9
- - 2.2.4