simp-beaker-helpers 1.19.1 → 1.19.3

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: de616faf054a99c350f9a6241296669ce630fff0d6d622fd60c9a36ea2e2a036
4
- data.tar.gz: cdbc0d01a23a79472998e87ccbd850e5a32f4e56aa04b623c1b05c050254df92
3
+ metadata.gz: 9eede146380997a5256ef8fc379350b7b2b44e5a4a1156e5a14f13a5be0d396d
4
+ data.tar.gz: 31345b9736832c517f96e327dd18ddaca39c9eb72b0d94b9b56e83344f83d645
5
5
  SHA512:
6
- metadata.gz: 9539f40a2fbf685e6d3a4763a69aaf5670d80e73a695eab4c029d294523612e847ca16132119a459d4381508e267642065c9f7ff99198ddabe8e4008562d7674
7
- data.tar.gz: b6ed70ae00c28cfe70705cc704df6206318734ae941ef5848751caa8a37506a1e6a4432fd324a7752aae5dfdcd5fc38baa0e029ae3e17fd5cb6094649432b29e
6
+ metadata.gz: 89e30957c049a514d97f58e99f2668682fa956e7a43a7414e69dff18d58f9af2f7ac2bf715ba72af97ffe6cdf93630dc3eeb68a45096b07adad069a907abaa93
7
+ data.tar.gz: 004cf046d60282beeecc534f39b45d4398cf4b35bccc0b9e46a6cdddf260cd2fd222ebb796e66e10f6cd9e518b7b806584716ccc0eb8734ff2c00181a3a53748
@@ -2,5 +2,6 @@
2
2
  fixtures:
3
3
  repositories:
4
4
  stdlib: https://github.com/simp/puppetlabs-stdlib
5
+ simplib: https://github.com/simp/pupmod-simp-simplib
5
6
  compliance_markup: https://github.com/simp/pupmod-simp-compliance_markup
6
7
 
@@ -1,131 +1,366 @@
1
+ # ------------------------------------------------------------------------------
2
+ # NOTICE: **This file is maintained with puppetsync**
3
+ #
4
+ # This file is updated automatically as part of a puppet module baseline.
5
+ #
6
+ # The next baseline sync will overwrite any local changes to everything above
7
+ # the line "# Repo-specific content"
8
+ # ------------------------------------------------------------------------------
9
+ # The testing matrix considers ruby/puppet versions supported by SIMP and PE:
10
+ #
11
+ # https://puppet.com/docs/pe/2019.8/component_versions_in_recent_pe_releases.html
12
+ # https://puppet.com/misc/puppet-enterprise-lifecycle
13
+ # https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
14
+ # ------------------------------------------------------------------------------
15
+ # Release Puppet Ruby EOL
16
+ # SIMP 6.4 5.5 2.4.10 TBD
17
+ # PE 2018.1 5.5 2.4.10 2021-01 (LTS overlap)
18
+ # PE 2019.8 6.18 2.5.7 2022-12 (LTS)
1
19
  ---
2
- .cache_bundler: &cache_bundler
20
+
21
+ stages:
22
+ - 'validation'
23
+ - 'acceptance'
24
+ - 'compliance'
25
+ - 'deployment'
26
+
27
+ variables:
28
+ # PUPPET_VERSION is a canary variable!
29
+ #
30
+ # The value `UNDEFINED` will (intentionally) cause `bundler install|update` to
31
+ # fail. The intended value for PUPPET_VERSION is provided by the `pup_#` YAML
32
+ # anchors. If it is still `UNDEFINED`, all the other setting from the job's
33
+ # anchor are also missing.
34
+ PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
35
+ BUNDLER_VERSION: '1.17.1'
36
+ SIMP_MATRIX_LEVEL: '1'
37
+ SIMP_FORCE_RUN_MATRIX: 'no'
38
+
39
+ # Force dependencies into a path the gitlab-runner user can write to.
40
+ # (This avoids some failures on Runners with misconfigured ruby environments.)
41
+ GEM_HOME: .vendor/gem_install
42
+ BUNDLE_CACHE_PATH: .vendor/bundle
43
+ BUNDLE_PATH: .vendor/bundle
44
+ BUNDLE_BIN: .vendor/gem_install/bin
45
+ BUNDLE_NO_PRUNE: 'true'
46
+
47
+
48
+ # bundler dependencies + caching, optional RVM setup, with diagnostic output
49
+ # --------------------------------------------------------------------------
50
+ .setup_bundler_env: &setup_bundler_env
3
51
  cache:
4
- untracked: true
5
- # A broad attempt at caching between runs (ala Travis CI)
6
- key: "${CI_PROJECT_NAMESPACE}__bundler"
52
+ # Cache bundler gems between pipelines for each Ruby version
53
+ key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
7
54
  paths:
8
55
  - '.vendor'
9
- - 'vendor'
10
-
11
- .setup_bundler_env: &setup_bundler_env
12
56
  before_script:
13
- - 'echo Files in cache: $(find .vendor | wc -l) || :'
14
- - 'export GEM_HOME=.vendor/gem_install'
15
- - 'export BUNDLE_CACHE_PATH=.vendor/bundler'
16
- - 'declare GEM_BUNDLER_VER=(-v ''~> ${BUNDLER_VERSION:-1.16.0}'')'
17
- - declare GEM_INSTALL=(gem install --no-document)
18
- - declare BUNDLER_INSTALL=(bundle install --no-binstubs --jobs $(nproc) --path=.vendor "${FLAGS[@]}")
19
- - gem list -ie "${GEM_BUNDLE_VER[@]}" --silent bundler || "${GEM_INSTALL[@]}" --local "${GEM_BUNDLE_VER[@]}" bundler || "${GEM_INSTALL[@]}" "${GEM_BUNDLE_VER[@]}" bundler
57
+ - 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
58
+ # Diagnostic ruby & gem information
59
+ - 'which ruby && ruby --version || :'
60
+ - "[[ $- == *i* ]] && echo 'Interactive shell session' || echo 'Non-interactive shell session'"
61
+ - "shopt -q login_shell && echo 'Login shell' || echo 'Not a login shell'"
62
+ - 'rvm ls || :'
63
+
64
+ # If RVM is available, make SURE it's using the right Ruby:
65
+ # * Source rvm (to run in non-login shells)
66
+ # * If any $MATRIX_RUBY_VERSION rubies are available, use the latest
67
+ # * Otherwise: install & use ${MATRIX_RUBY_VERSION}-head (e.g., latest)
68
+ # * ^^ This could be wonky and introduce variations across runners
69
+ # * ^^ maybe it should just fail if there is no $MATRIX_RUBY_VERSION installed?
70
+ - "command -v rvm && { if declare -p rvm_path &> /dev/null; then source \"${rvm_path}/scripts/rvm\"; else source \"$HOME/.rvm/scripts/rvm\" || source /etc/profile.d/rvm.sh; fi; }"
71
+ - "command -v rvm && { LATEST_RVM_RUBY_XY=\"$(rvm ls | grep \"$MATRIX_RUBY_VERSION\" | tail -1 | sed -e 's/^.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*$/\\1/g')\"; if [ -z \"$LATEST_RVM_RUBY_XY\" ]; then LATEST_RVM_RUBY_XY=\"${MATRIX_RUBY_VERSION}-head\"; rvm install \"$LATEST_RVM_RUBY\" --no-docs; else echo \"Found RVM Ruby: '${LATEST_RVM_RUBY_XY}'\"; fi; rvm use \"$LATEST_RVM_RUBY_XY\" ; }"
72
+ - 'ruby --version || :'
73
+ - 'gem list sync || :'
74
+
75
+ # Bundle gems (preferring cached > local > downloaded resources)
76
+ # * Try to use cached and local resources before downloading dependencies
77
+ - 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
78
+ - 'declare GEM_INSTALL_CMD=(gem install --no-document)'
79
+ - 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
80
+ - 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
81
+ - 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
20
82
  - 'rm -rf pkg/ || :'
21
- - bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL[@]}" --local || "${BUNDLER_INSTALL[@]}")
83
+ - 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'
84
+
85
+ # Diagnostic bundler, ruby, and gem checks:
86
+ - 'bundle exec rvm ls || :'
87
+ - 'bundle exec which ruby || :'
88
+ - 'bundle show sync || :'
89
+ - 'bundle exec gem list sync || :'
90
+
91
+
92
+ # Assign a matrix level when your test will run. Heavier jobs get higher numbers
93
+ # NOTE: To skip all jobs with a SIMP_MATRIX_LEVEL, set SIMP_MATRIX_LEVEL=0
94
+ # ------------------------------------------------------------------------------
95
+
96
+ .relevant_file_conditions_trigger_spec_tests: &relevant_file_conditions_trigger_spec_tests
97
+ changes:
98
+ - .gitlab-ci.yml
99
+ - .fixtures.yml
100
+ - "spec/spec_helper.rb"
101
+ - "spec/{classes,unit,defines,type_aliases,types,hosts}/**/*.rb"
102
+ - "{manifests,files,types}/**/*"
103
+ - "templates/*.{erb,epp}"
104
+ - "lib/**/*"
105
+ - "Gemfile"
106
+ - "SIMP/**/*"
107
+ - "data/**/*"
108
+ exists:
109
+ - "spec/{classes,unit,defines,type_aliases,types,hosts}/**/*_spec.rb"
110
+
111
+ .relevant_file_conditions_trigger_acceptance_tests: &relevant_file_conditions_trigger_acceptance_tests
112
+ changes:
113
+ - .gitlab-ci.yml
114
+ - "spec/spec_helper_acceptance.rb"
115
+ - "spec/acceptance/**/*"
116
+ - "{manifests,files,types}/**/*"
117
+ - "templates/*.{erb,epp}"
118
+ - "lib/**/*"
119
+ - "Gemfile"
120
+ - "SIMP/**/*"
121
+ - "data/**/*"
122
+ exists:
123
+ - "spec/acceptance/**/*_spec.rb"
124
+
125
+ # For some reason, the rule regexes stopped matching line starts inside
126
+ # $CI_COMMIT_MESSAGE with carets /^/, so we're using /\n?/ as a workaround.
127
+ .skip_job_when_commit_message_says_to: &skip_job_when_commit_message_says_to
128
+ if: '$CI_COMMIT_MESSAGE =~ /\n?CI: (SKIP MATRIX|MATRIX LEVEL 0)/'
129
+ when: never
130
+
131
+ .force_run_job_when_commit_message_lvl_1_or_above: &force_run_job_when_commit_mssage_lvl_1_or_above
132
+ if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [123]/'
133
+ when: on_success
134
+
135
+ .force_run_job_when_commit_message_lvl_2_or_above: &force_run_job_when_commit_mssage_lvl_2_or_above
136
+ if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [23]/'
137
+ when: on_success
138
+
139
+ .force_run_job_when_commit_message_lvl_3_or_above: &force_run_job_when_commit_mssage_lvl_3_or_above
140
+ if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [3]/'
141
+ when: on_success
22
142
 
23
- .spec_tests: &spec_tests
143
+ # check for $CI_PIPELINE_SOURCE needed because this is combined w/when:changes
144
+ .run_job_when_level_1_or_above_w_changes: &run_job_when_level_1_or_above_w_changes
145
+ if: '$SIMP_MATRIX_LEVEL =~ /^[123]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
146
+ when: on_success
147
+
148
+ .run_job_when_level_2_or_above_w_changes: &run_job_when_level_2_or_above_w_changes
149
+ if: '$SIMP_MATRIX_LEVEL =~ /^[23]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
150
+ when: on_success
151
+
152
+ .run_job_when_level_3_or_above_w_changes: &run_job_when_level_3_or_above_w_changes
153
+ if: '$SIMP_MATRIX_LEVEL =~ /^[3]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
154
+ when: on_success
155
+
156
+ .force_run_job_when_var_and_lvl_1_or_above: &force_run_job_when_var_and_lvl_1_or_above
157
+ if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[123]$/'
158
+ when: on_success
159
+
160
+ .force_run_job_when_var_and_lvl_2_or_above: &force_run_job_when_var_and_lvl_2_or_above
161
+ if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[23]$/'
162
+ when: on_success
163
+
164
+ .force_run_job_when_var_and_lvl_3_or_above: &force_run_job_when_var_and_lvl_3_or_above
165
+ if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[3]$/'
166
+ when: on_success
167
+
168
+
169
+
170
+ # SIMP_MATRIX_LEVEL=1: Intended to run every commit
171
+ .with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
172
+ rules:
173
+ - <<: *skip_job_when_commit_message_says_to
174
+ - <<: *force_run_job_when_var_and_lvl_1_or_above
175
+ - <<: *force_run_job_when_commit_mssage_lvl_1_or_above
176
+ - <<: *run_job_when_level_1_or_above_w_changes
177
+ <<: *relevant_file_conditions_trigger_acceptance_tests
178
+ - when: never
179
+
180
+ .with_SIMP_SPEC_MATRIX_LEVEL_1: &with_SIMP_SPEC_MATRIX_LEVEL_1
181
+ rules:
182
+ - <<: *skip_job_when_commit_message_says_to
183
+ - <<: *force_run_job_when_commit_mssage_lvl_1_or_above
184
+ - <<: *force_run_job_when_var_and_lvl_1_or_above
185
+ - <<: *run_job_when_level_1_or_above_w_changes
186
+ <<: *relevant_file_conditions_trigger_spec_tests
187
+ - when: never
188
+
189
+ # SIMP_MATRIX_LEVEL=2: Resource-heavy or redundant jobs
190
+ .with_SIMP_ACCEPTANCE_MATRIX_LEVEL_2: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_2
191
+ rules:
192
+ - <<: *skip_job_when_commit_message_says_to
193
+ - <<: *force_run_job_when_var_and_lvl_2_or_above
194
+ - <<: *force_run_job_when_commit_mssage_lvl_2_or_above
195
+ - <<: *run_job_when_level_2_or_above_w_changes
196
+ <<: *relevant_file_conditions_trigger_acceptance_tests
197
+ - when: never
198
+
199
+ .with_SIMP_SPEC_MATRIX_LEVEL_2: &with_SIMP_SPEC_MATRIX_LEVEL_2
200
+ rules:
201
+ - <<: *skip_job_when_commit_message_says_to
202
+ - <<: *force_run_job_when_commit_mssage_lvl_2_or_above
203
+ - <<: *force_run_job_when_var_and_lvl_2_or_above
204
+ - <<: *run_job_when_level_2_or_above_w_changes
205
+ <<: *relevant_file_conditions_trigger_spec_tests
206
+ - when: never
207
+
208
+ # SIMP_MATRIX_LEVEL=3: Reserved for FULL matrix testing
209
+ .with_SIMP_ACCEPTANCE_MATRIX_LEVEL_3: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_3
210
+ rules:
211
+ - <<: *skip_job_when_commit_message_says_to
212
+ - <<: *force_run_job_when_var_and_lvl_3_or_above
213
+ - <<: *force_run_job_when_commit_mssage_lvl_3_or_above
214
+ - <<: *run_job_when_level_3_or_above_w_changes
215
+ <<: *relevant_file_conditions_trigger_acceptance_tests
216
+ - when: never
217
+
218
+
219
+ # Puppet Versions
220
+ #-----------------------------------------------------------------------
221
+
222
+ .pup_5: &pup_5
223
+ image: 'ruby:2.4'
224
+ variables:
225
+ PUPPET_VERSION: '~> 5.0'
226
+ BEAKER_PUPPET_COLLECTION: 'puppet5'
227
+ MATRIX_RUBY_VERSION: '2.4'
228
+
229
+ .pup_6: &pup_6
230
+ image: 'ruby:2.5'
231
+ variables:
232
+ PUPPET_VERSION: '~> 6.0'
233
+ BEAKER_PUPPET_COLLECTION: 'puppet6'
234
+ MATRIX_RUBY_VERSION: '2.5'
235
+
236
+ .pup_6_18_0: &pup_6_18_0
237
+ image: 'ruby:2.5'
238
+ variables:
239
+ PUPPET_VERSION: '6.18.0'
240
+ BEAKER_PUPPET_COLLECTION: 'puppet6'
241
+ MATRIX_RUBY_VERSION: '2.5'
242
+
243
+ .pup_7: &pup_7
244
+ image: 'ruby:2.7'
245
+ variables:
246
+ PUPPET_VERSION: '~> 7.0'
247
+ BEAKER_PUPPET_COLLECTION: 'puppet7'
248
+ MATRIX_RUBY_VERSION: '2.7'
249
+
250
+ # Testing Environments
251
+ #-----------------------------------------------------------------------
252
+
253
+ .lint_tests: &lint_tests
254
+ stage: 'validation'
255
+ tags: ['docker']
256
+ <<: *setup_bundler_env
257
+ script:
258
+ - 'bundle exec rake syntax'
259
+ - 'bundle exec rake lint'
260
+ - 'bundle exec rake metadata_lint'
261
+
262
+ .unit_tests: &unit_tests
263
+ stage: 'validation'
264
+ tags: ['docker']
265
+ <<: *setup_bundler_env
266
+ <<: *with_SIMP_SPEC_MATRIX_LEVEL_1
24
267
  script:
25
- - bundle exec rake spec
268
+ - 'bundle exec rake spec'
26
269
 
27
- # To avoid running a prohibitive number of tests every commit,
28
- # don't set this env var in your gitlab instance
29
- .only_with_SIMP_FULL_MATRIX: &only_with_SIMP_FULL_MATRIX
30
- only:
31
- variables:
32
- - $SIMP_FULL_MATRIX
270
+ .acceptance_base: &acceptance_base
271
+ stage: 'acceptance'
272
+ tags: ['beaker']
273
+ <<: *setup_bundler_env
274
+ <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
33
275
 
34
- stages:
35
- - unit
36
- - acceptance
37
-
38
- 2_4-unit:
39
- stage: unit
40
- tags:
41
- - docker
42
- image: ruby:2.4
43
- <<: *cache_bundler
276
+ .compliance_base: &compliance_base
277
+ stage: 'compliance'
278
+ tags: ['beaker']
44
279
  <<: *setup_bundler_env
45
- <<: *spec_tests
280
+ <<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
281
+
282
+
283
+ # Unit Tests
284
+ #-----------------------------------------------------------------------
285
+
286
+ pup5-unit:
287
+ <<: *pup_5
288
+ <<: *unit_tests
289
+ <<: *with_SIMP_SPEC_MATRIX_LEVEL_2
290
+
291
+ pup6-unit:
292
+ <<: *pup_6
293
+ <<: *unit_tests
294
+ <<: *with_SIMP_SPEC_MATRIX_LEVEL_2
295
+
296
+ pup6.18.0-unit:
297
+ <<: *pup_6_18_0
298
+ <<: *unit_tests
299
+
300
+ pup7-unit:
301
+ <<: *pup_7
302
+ <<: *unit_tests
303
+ <<: *with_SIMP_SPEC_MATRIX_LEVEL_2
304
+
305
+ # ------------------------------------------------------------------------------
306
+ # NOTICE: **This file is maintained with puppetsync**
307
+ #
308
+ # Everything above the "Repo-specific content" comment will be overwritten by
309
+ # the next puppetsync.
310
+ # ------------------------------------------------------------------------------
311
+
312
+ # Repo-specific content
313
+ # ==============================================================================
46
314
 
47
315
 
48
316
  #=======================================================================
49
317
  # Acceptance tests
50
318
  default:
51
- stage: acceptance
52
- tags:
53
- - beaker
54
- <<: *cache_bundler
55
- <<: *setup_bundler_env
319
+ <<: *pup_6
320
+ <<: *acceptance_base
56
321
  script:
57
- - bundle exec rake spec_clean
58
322
  - bundle exec rake beaker:suites[default]
59
323
 
60
324
  default-fips:
61
- stage: acceptance
62
- tags:
63
- - beaker
64
- <<: *cache_bundler
65
- <<: *setup_bundler_env
66
- variables:
67
- BEAKER_fips: 'yes'
325
+ <<: *pup_6
326
+ <<: *acceptance_base
68
327
  script:
69
- - bundle exec rake spec_clean
70
- - bundle exec rake beaker:suites[default]
328
+ - BEAKER_fips=yes bundle exec rake beaker:suites[default]
71
329
 
72
330
  fips_from_fixtures:
73
- stage: acceptance
74
- tags:
75
- - beaker
76
- <<: *cache_bundler
77
- <<: *setup_bundler_env
78
- variables:
79
- PUPPET_VERSION: '~> 5.3'
80
- BEAKER_PUPPET_COLLECTION: 'puppet5'
331
+ <<: *pup_6
332
+ <<: *acceptance_base
81
333
  script:
82
- - bundle exec rake spec_clean
83
334
  - bundle exec rake beaker:suites[fips_from_fixtures]
84
335
 
85
336
  puppet5_collections:
86
- stage: acceptance
87
- tags:
88
- - beaker
89
- <<: *cache_bundler
90
- <<: *setup_bundler_env
91
- variables:
92
- PUPPET_VERSION: '~> 5.3'
337
+ <<: *pup_5
338
+ <<: *acceptance_base
93
339
  script:
94
- - bundle exec rake spec_clean
95
340
  - bundle exec rake beaker:suites[puppet_collections]
96
341
 
97
342
  puppet6_collections:
98
- stage: acceptance
99
- tags:
100
- - beaker
101
- <<: *cache_bundler
102
- <<: *setup_bundler_env
103
- variables:
104
- BEAKER_PUPPET_COLLECTION: 'puppet6'
343
+ <<: *pup_6
344
+ <<: *acceptance_base
345
+ script:
346
+ - bundle exec rake beaker:suites[puppet_collections]
347
+
348
+ puppet7_collections:
349
+ <<: *pup_7
350
+ <<: *acceptance_base
105
351
  script:
106
- - bundle exec rake spec_clean
107
352
  - bundle exec rake beaker:suites[puppet_collections]
108
353
 
109
354
  windows:
110
- stage: acceptance
111
- tags:
112
- - beaker
113
- <<: *cache_bundler
114
- <<: *setup_bundler_env
355
+ <<: *pup_6
356
+ <<: *acceptance_base
115
357
  script:
116
- - bundle exec rake spec_clean
117
358
  - bundle exec rake beaker:suites[windows]
118
359
 
119
360
  snapshot:
120
- stage: acceptance
361
+ <<: *pup_6
362
+ <<: *acceptance_base
121
363
  # This is prone to breakage in the underlying system
122
364
  allow_failure: true
123
- tags:
124
- - beaker
125
- <<: *cache_bundler
126
- <<: *setup_bundler_env
127
- variables:
128
- BEAKER_simp_snapshot: 'yes'
129
365
  script:
130
- - bundle exec rake spec_clean
131
- - bundle exec rake beaker:suites[snapshot]
366
+ - BEAKER_simp_snapshot=yes bundle exec rake beaker:suites[snapshot]
@@ -1,36 +1,42 @@
1
1
  ---
2
- language: ruby
3
- cache: bundler
4
- sudo: false
5
- before_install:
6
- - rm Gemfile.lock || true
7
- bundler_args: "--without development --path .vendor"
2
+ language: shell
8
3
  notifications:
9
4
  email: false
10
- rvm:
11
- - 2.4.4
12
- env:
13
- - SIMP_SKIP_NON_SIMPOS_TESTS=1
14
- script:
15
- - bundle exec rake spec
16
- before_deploy:
17
- - bundle exec rake clobber
18
- - "export GEM_VERSION=`ruby -r ./lib/simp/beaker_helpers/version.rb -e 'puts Simp::BeakerHelpers::VERSION'`"
19
- - '[[ $TRAVIS_TAG =~ ^${GEM_VERSION}$ ]]'
20
- deploy:
21
- - provider: rubygems
22
- gemspec: simp-beaker-helpers.gemspec
23
- gem: simp-beaker-helpers
24
- api_key:
25
- secure: "AlnBx0dBSxn+S97n0h14ltKUOA+6v0bc7QZPIcwGJV9nnf1hKH3pf9La1TVknEx7XgpAcM9jusQJ7hBlqvSq8z8SFF0bZk1EgSRIKc1cuYPLiGyUM2O7+AFHyCy3iCnPvKeoQmE/BJb5O1dGnbmSbf4A0fqLxA7jiHG1j7z+cnmJB1i67wovDfl13TsOXyBfbespWBMMc0BKAw56FPs9XggAk2cNusS3hd5tqW1AZPT2/xwt+d8ngkmO96u8QcichYRFQ+w+XW4H0w935wNg/dWiskJlt7TIYVAh4Ko5s2DZKf52Tne8TugALSn0LhRatpp7sw1FTTpteCW8UqK8uwGC2hM4pZViAOv4P1YObz2IPOZPriBl+cCayJdMKnotkUJliAMnw5TLiSWKLou+S0Pdj2h3fJZWdOEwRPMzIVoJtsOHG3GdNcPL6f7iU0vP/wr6FeR3uWa+fA7NHRi2Du955O8JpogjdrW08ahcAEwhtI3A4mrA08wN09axsrwr093uDRm/5h4FHyAhExJ0YiA/6kcPpUvILcLStyHe0RQDICQMdsQo2DSbnL65w3QjFa2fML2Shf9cRwX06+ia2BxozWzFD/6p3RiRtPxphnbFiUdjYSGWcwCcUgbJx9SW04lSSxOhpyItuXgxZqiybkzstXd6riu5zwg1R8TWk34="
26
- on:
27
- tags: true
28
- rvm: 2.4.4
29
- condition: "($SKIP_PUBLISH != true)"
30
- - provider: releases
31
- api_key:
32
- secure: "I41p4aqjkrNDHJhZ5gWC4gzn7BVwEYRm5Q3PAxQRSIUDB/QTVgNqZx8YptkuIvSGpw8kIywyZg3NKdzGUO8aJJ0NlXapL7e9qQIigkYhdaCZjZFG5zIxdOFs4sVoz/6vnQT9JIcGWy7uS5xiNOulGvfEWU78+e+I9yPdT74RApve5VAVT/km5lV5ldRnwwehLnTx+volUlnOD8rwfizoVLqFTrfRfr4cVMF605UYyaiVxHF50hywFRZoAdVcMEhlLQnQXfz/ZsLMJLJm9eCpjQ989N0oX6theSLCcv7QtHcWMXydjWMcpuTfBZSFrwUVbC23uMOKTJVEWq5LMG3m2L6hP3//2gvUzGhOVLvoGuC+erboB7QoXdcoOgXY+dTZPMcPBxpArdDLWVQSLTvPs05QzpaUdRLVMC/kD1d1EudlEicgkNgNDBhBn3089nVmvKndbKLvj+23a5AQVVbs+8C0x+SJvTc9N2N+bmuH7jIJPrEvWK4xwcQa+g2M/EBv05jaEdSErlVa6B6UKCH0Lea9rpy1se9vn5OzpaaMCCJIpcpQqHDjo0PMAQXBSbqjKcBei6lR5fIFl5UO9gWP1v8PGPuCzGTBivQ92XlgV1TWXmdbJHwIuSbJx3Ali7Wp19RR4E4uHC+TPFssvgkh9ZLkORnWWS35wzzU1LkwWx0="
33
- on:
34
- tags: true
35
- rvm: 2.4.4
36
- condition: "($SKIP_PUBLISH != true)"
5
+ stages:
6
+ - name: deploy
7
+ if: 'tag IS present'
8
+
9
+ ### Testing on Travis CI is indefinitely disabled
10
+ ###
11
+ ### See:
12
+ ### * https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
13
+ ### * https://simp-project.atlassian.net/browse/SIMP-8703
14
+ jobs:
15
+ include:
16
+ - stage: deploy
17
+ script: skip
18
+ cache: bundler
19
+ before_install:
20
+ - rm Gemfile.lock || true
21
+ bundler_args: "--without development --path .vendor"
22
+ language: ruby
23
+ rvm: 2.4.5
24
+ before_deploy:
25
+ - bundle exec rake clobber
26
+ - "export GEM_VERSION=`ruby -r ./lib/simp/beaker_helpers/version.rb -e 'puts Simp::BeakerHelpers::VERSION'`"
27
+ - '[[ $TRAVIS_TAG =~ ^${GEM_VERSION}$ ]]'
28
+ deploy:
29
+ - provider: rubygems
30
+ gemspec: simp-beaker-helpers.gemspec
31
+ gem: simp-beaker-helpers
32
+ token:
33
+ secure: "AlnBx0dBSxn+S97n0h14ltKUOA+6v0bc7QZPIcwGJV9nnf1hKH3pf9La1TVknEx7XgpAcM9jusQJ7hBlqvSq8z8SFF0bZk1EgSRIKc1cuYPLiGyUM2O7+AFHyCy3iCnPvKeoQmE/BJb5O1dGnbmSbf4A0fqLxA7jiHG1j7z+cnmJB1i67wovDfl13TsOXyBfbespWBMMc0BKAw56FPs9XggAk2cNusS3hd5tqW1AZPT2/xwt+d8ngkmO96u8QcichYRFQ+w+XW4H0w935wNg/dWiskJlt7TIYVAh4Ko5s2DZKf52Tne8TugALSn0LhRatpp7sw1FTTpteCW8UqK8uwGC2hM4pZViAOv4P1YObz2IPOZPriBl+cCayJdMKnotkUJliAMnw5TLiSWKLou+S0Pdj2h3fJZWdOEwRPMzIVoJtsOHG3GdNcPL6f7iU0vP/wr6FeR3uWa+fA7NHRi2Du955O8JpogjdrW08ahcAEwhtI3A4mrA08wN09axsrwr093uDRm/5h4FHyAhExJ0YiA/6kcPpUvILcLStyHe0RQDICQMdsQo2DSbnL65w3QjFa2fML2Shf9cRwX06+ia2BxozWzFD/6p3RiRtPxphnbFiUdjYSGWcwCcUgbJx9SW04lSSxOhpyItuXgxZqiybkzstXd6riu5zwg1R8TWk34="
34
+ on:
35
+ tags: true
36
+ condition: "($SKIP_PUBLISH != true)"
37
+ - provider: releases
38
+ token:
39
+ secure: "I41p4aqjkrNDHJhZ5gWC4gzn7BVwEYRm5Q3PAxQRSIUDB/QTVgNqZx8YptkuIvSGpw8kIywyZg3NKdzGUO8aJJ0NlXapL7e9qQIigkYhdaCZjZFG5zIxdOFs4sVoz/6vnQT9JIcGWy7uS5xiNOulGvfEWU78+e+I9yPdT74RApve5VAVT/km5lV5ldRnwwehLnTx+volUlnOD8rwfizoVLqFTrfRfr4cVMF605UYyaiVxHF50hywFRZoAdVcMEhlLQnQXfz/ZsLMJLJm9eCpjQ989N0oX6theSLCcv7QtHcWMXydjWMcpuTfBZSFrwUVbC23uMOKTJVEWq5LMG3m2L6hP3//2gvUzGhOVLvoGuC+erboB7QoXdcoOgXY+dTZPMcPBxpArdDLWVQSLTvPs05QzpaUdRLVMC/kD1d1EudlEicgkNgNDBhBn3089nVmvKndbKLvj+23a5AQVVbs+8C0x+SJvTc9N2N+bmuH7jIJPrEvWK4xwcQa+g2M/EBv05jaEdSErlVa6B6UKCH0Lea9rpy1se9vn5OzpaaMCCJIpcpQqHDjo0PMAQXBSbqjKcBei6lR5fIFl5UO9gWP1v8PGPuCzGTBivQ92XlgV1TWXmdbJHwIuSbJx3Ali7Wp19RR4E4uHC+TPFssvgkh9ZLkORnWWS35wzzU1LkwWx0="
40
+ on:
41
+ tags: true
42
+ condition: "($SKIP_PUBLISH != true)"
@@ -1,3 +1,13 @@
1
+ ### 1.19.3 / 2021-01-01
2
+ * Fixed:
3
+ * Ensure that `pfact_on` can handle fact dot notation
4
+ * Changed:
5
+ * Silenced some of the noisy commands that didn't provide value-add output
6
+
7
+ ### 1.19.2 / 2020-12-19
8
+ * Fixed:
9
+ * Fixed an issue with pfact_on
10
+
1
11
  ### 1.19.1 / 2020-12-02
2
12
  * Fixed:
3
13
  * Bumped the core puppet version to 6.X
@@ -66,6 +66,8 @@ module Simp::BeakerHelpers
66
66
 
67
67
  if sut[:hypervisor] == 'docker'
68
68
  exclude_list = []
69
+ opts[:silent] ||= true
70
+
69
71
  if opts.has_key?(:ignore) && !opts[:ignore].empty?
70
72
  opts[:ignore].each do |value|
71
73
  exclude_list << "--exclude '#{value}'"
@@ -114,9 +116,15 @@ module Simp::BeakerHelpers
114
116
 
115
117
  # use the `puppet fact` face to look up facts on an SUT
116
118
  def pfact_on(sut, fact_name)
117
- facts_json = on(sut,'puppet facts find xxx').output
118
- facts = JSON.parse(facts_json).fetch( 'values' )
119
- facts.fetch(fact_name)
119
+ require 'ostruct'
120
+
121
+ if sut.which('puppet').empty?
122
+ fact_on(sut, fact_name, :silent => true)
123
+ else
124
+ facts_json = on(sut,'puppet facts find garbage_xxx', :silent => true).stdout
125
+ facts = JSON.parse(facts_json, object_class: OpenStruct).values
126
+ facts.dig(*(fact_name.split('.'))) || ''
127
+ end
120
128
  end
121
129
 
122
130
  # Returns the modulepath on the SUT, as an Array
@@ -980,7 +988,7 @@ done
980
988
  # @returns [String] Path to the Hieradata directory on the target system
981
989
  def hiera_datadir(sut)
982
990
  # This output lets us know where Hiera is configured to look on the system
983
- puppet_lookup_info = on(sut, 'puppet lookup --explain test__simp__test').output.strip.lines
991
+ puppet_lookup_info = on(sut, 'puppet lookup --explain test__simp__test', :silent => true).output.strip.lines
984
992
 
985
993
  if sut.puppet_configprint['manifest'].nil? || sut.puppet_configprint['manifest'].empty?
986
994
  fail("No output returned from `puppet config print manifest` on #{sut}")
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.19.1'
4
+ VERSION = '1.19.3'
5
5
  end
@@ -8,15 +8,25 @@ context 'after copy_fixture_modules_to( hosts )' do
8
8
 
9
9
  describe "fact_on(master,'root_home')" do
10
10
  it 'should not return value of `root_home`' do
11
- puts fact = fact_on(master, 'root_home')
12
- expect( fact ).to eq ''
11
+ expect(fact_on(master, 'root_home')).to eq ''
13
12
  end
14
13
  end
15
14
 
16
15
  describe "pfact_on(master,'root_home')" do
17
16
  it 'should return value of `root_home`' do
18
- puts fact = pfact_on(master, 'root_home')
19
- expect( fact ).to eq '/root'
17
+ expect(pfact_on(master, 'root_home')).to eq '/root'
18
+ end
19
+ end
20
+
21
+ describe "pfact_on(master,'os.release.major')" do
22
+ it 'should return the value of `os.release.major`' do
23
+ expect(pfact_on(master, 'os.release.major')).to match(/.+/)
24
+ end
25
+ end
26
+
27
+ describe "pfact_on(master,'os.release.foo')" do
28
+ it 'should not return the value of `os.release.foo`' do
29
+ expect(pfact_on(master, 'os.release.foo')).to eq ''
20
30
  end
21
31
  end
22
32
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.1
4
+ version: 1.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-10 00:00:00.000000000 Z
12
+ date: 2021-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -192,13 +192,11 @@ files:
192
192
  - spec/acceptance/suites/default/enable_fips_spec.rb
193
193
  - spec/acceptance/suites/default/fixture_modules_spec.rb
194
194
  - spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
195
- - spec/acceptance/suites/default/nodesets
196
195
  - spec/acceptance/suites/default/pki_tests_spec.rb
197
196
  - spec/acceptance/suites/default/set_hieradata_on_spec.rb
198
197
  - spec/acceptance/suites/default/write_hieradata_to_spec.rb
199
198
  - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
200
199
  - spec/acceptance/suites/fips_from_fixtures/metadata.yml
201
- - spec/acceptance/suites/fips_from_fixtures/nodesets
202
200
  - spec/acceptance/suites/offline/00_default_spec.rb
203
201
  - spec/acceptance/suites/offline/README
204
202
  - spec/acceptance/suites/offline/nodesets/default.yml
@@ -206,7 +204,6 @@ files:
206
204
  - spec/acceptance/suites/puppet_collections/metadata.yml
207
205
  - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
208
206
  - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
209
- - spec/acceptance/suites/snapshot/nodesets
210
207
  - spec/acceptance/suites/windows/00_default_spec.rb
211
208
  - spec/acceptance/suites/windows/metadata.yml
212
209
  - spec/acceptance/suites/windows/nodesets/default.yml
@@ -220,7 +217,7 @@ licenses:
220
217
  - Apache-2.0
221
218
  metadata:
222
219
  issue_tracker: https://simp-project.atlassian.net
223
- post_install_message:
220
+ post_install_message:
224
221
  rdoc_options: []
225
222
  require_paths:
226
223
  - lib
@@ -235,8 +232,33 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
232
  - !ruby/object:Gem::Version
236
233
  version: '0'
237
234
  requirements: []
238
- rubygems_version: 3.0.8
239
- signing_key:
235
+ rubygems_version: 3.0.9
236
+ signing_key:
240
237
  specification_version: 4
241
238
  summary: beaker helper methods for SIMP
242
- test_files: []
239
+ test_files:
240
+ - spec/acceptance/nodesets/default.yml
241
+ - spec/acceptance/suites/default/check_puppet_version_spec.rb
242
+ - spec/acceptance/suites/default/enable_fips_spec.rb
243
+ - spec/acceptance/suites/default/fixture_modules_spec.rb
244
+ - spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
245
+ - spec/acceptance/suites/default/pki_tests_spec.rb
246
+ - spec/acceptance/suites/default/set_hieradata_on_spec.rb
247
+ - spec/acceptance/suites/default/write_hieradata_to_spec.rb
248
+ - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
249
+ - spec/acceptance/suites/fips_from_fixtures/metadata.yml
250
+ - spec/acceptance/suites/offline/00_default_spec.rb
251
+ - spec/acceptance/suites/offline/README
252
+ - spec/acceptance/suites/offline/nodesets/default.yml
253
+ - spec/acceptance/suites/puppet_collections/00_default_spec.rb
254
+ - spec/acceptance/suites/puppet_collections/metadata.yml
255
+ - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
256
+ - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
257
+ - spec/acceptance/suites/windows/00_default_spec.rb
258
+ - spec/acceptance/suites/windows/metadata.yml
259
+ - spec/acceptance/suites/windows/nodesets/default.yml
260
+ - spec/acceptance/suites/windows/nodesets/win2016.yml
261
+ - spec/acceptance/suites/windows/nodesets/win2019.yml
262
+ - spec/lib/simp/beaker_helpers_spec.rb
263
+ - spec/spec_helper.rb
264
+ - spec/spec_helper_acceptance.rb
@@ -1 +0,0 @@
1
- ../../nodesets
@@ -1 +0,0 @@
1
- ../../nodesets
@@ -1 +0,0 @@
1
- ../../nodesets