simp-beaker-helpers 2.0.4 → 3.0.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 +4 -4
- data/.github/workflows/add_new_issue_to_triage_project.yml +1 -1
- data/.github/workflows/pr_acceptance.yml +1 -12
- data/.github/workflows/pr_tests.yml +10 -8
- data/.github/workflows/tag_deploy_rubygem.yml +6 -6
- data/CHANGELOG.md +26 -0
- data/Gemfile +5 -5
- data/lib/simp/beaker_helpers/constants.rb +1 -3
- data/lib/simp/beaker_helpers/version.rb +2 -2
- data/lib/simp/beaker_helpers/windows.rb +2 -2
- data/lib/simp/beaker_helpers.rb +24 -16
- data/lib/simp/rake/beaker.rb +4 -4
- data/renovate.json +3 -1
- data/simp-beaker-helpers.gemspec +1 -0
- data/spec/acceptance/suites/default/check_puppet_version_spec.rb +14 -8
- data/spec/acceptance/suites/default/fixture_modules_spec.rb +1 -1
- data/spec/acceptance/suites/default/install_simp_deps_repo_spec.rb +13 -10
- data/spec/acceptance/suites/default/pki_tests_spec.rb +18 -9
- data/spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb +5 -1
- data/spec/acceptance/suites/inspec/00_default_spec.rb +1 -1
- data/spec/acceptance/suites/puppet_collections/00_default_spec.rb +10 -8
- data/spec/fixtures/inspec_profiles/CentOS-7-disa_stig +1 -1
- data/spec/lib/simp/beaker_helpers_spec.rb +45 -0
- metadata +23 -11
- data/.gitlab-ci.yml +0 -386
- data/lib/simp/beaker_helpers/ssg.rb +0 -479
- data/spec/acceptance/suites/ssg/00_default_spec.rb +0 -49
- data/spec/acceptance/suites/ssg/metadata.yml +0 -2
- data/spec/acceptance/suites/ssg/nodesets +0 -1
|
@@ -131,10 +131,15 @@ describe 'Simp::BeakerHelpers' do
|
|
|
131
131
|
|
|
132
132
|
context '#get_puppet_install_info' do
|
|
133
133
|
after(:each) do
|
|
134
|
+
ENV['BEAKER_OPENVOX_AGENT_VERSION'] = nil
|
|
134
135
|
ENV['BEAKER_PUPPET_AGENT_VERSION'] = nil
|
|
136
|
+
ENV['OPENVOX_INSTALL_VERSION'] = nil
|
|
135
137
|
ENV['PUPPET_INSTALL_VERSION'] = nil
|
|
138
|
+
ENV['OPENVOX_VERSION'] = nil
|
|
136
139
|
ENV['PUPPET_VERSION'] = nil
|
|
140
|
+
ENV['BEAKER_OPENVOX_COLLECTION'] = nil
|
|
137
141
|
ENV['BEAKER_PUPPET_COLLECTION'] = nil
|
|
142
|
+
ENV['OPENVOX_INSTALL_TYPE'] = nil
|
|
138
143
|
ENV['PUPPET_INSTALL_TYPE'] = nil
|
|
139
144
|
end
|
|
140
145
|
|
|
@@ -222,6 +227,46 @@ describe 'Simp::BeakerHelpers' do
|
|
|
222
227
|
expect(helper.get_puppet_install_info).to eq expected
|
|
223
228
|
end
|
|
224
229
|
|
|
230
|
+
it 'extracts info from OPENVOX_VERSION' do
|
|
231
|
+
allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
|
|
232
|
+
ENV['OPENVOX_VERSION'] = '5.5.0'
|
|
233
|
+
expected = {
|
|
234
|
+
puppet_install_version: '5.5.0',
|
|
235
|
+
puppet_collection: 'puppet5',
|
|
236
|
+
puppet_install_type: 'agent'
|
|
237
|
+
}
|
|
238
|
+
expect(helper.get_puppet_install_info).to eq expected
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
it 'extracts openvox info from BEAKER_OPENVOX_COLLECTION' do
|
|
242
|
+
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
|
|
243
|
+
ENV['BEAKER_OPENVOX_COLLECTION'] = 'openvox8'
|
|
244
|
+
expected = {
|
|
245
|
+
puppet_install_version: '8.19.2',
|
|
246
|
+
puppet_collection: 'openvox8',
|
|
247
|
+
puppet_install_type: 'agent'
|
|
248
|
+
}
|
|
249
|
+
expect(helper.get_puppet_install_info).to eq expected
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
it 'prefers BEAKER_OPENVOX_COLLECTION over BEAKER_PUPPET_COLLECTION' do
|
|
253
|
+
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
|
|
254
|
+
ENV['BEAKER_OPENVOX_COLLECTION'] = 'openvox8'
|
|
255
|
+
ENV['BEAKER_PUPPET_COLLECTION'] = 'puppet5'
|
|
256
|
+
expected = {
|
|
257
|
+
puppet_install_version: '8.19.2',
|
|
258
|
+
puppet_collection: 'openvox8',
|
|
259
|
+
puppet_install_type: 'agent'
|
|
260
|
+
}
|
|
261
|
+
expect(helper.get_puppet_install_info).to eq expected
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
it 'extracts info from OPENVOX_INSTALL_TYPE' do
|
|
265
|
+
ENV['OPENVOX_INSTALL_TYPE'] = 'pe'
|
|
266
|
+
|
|
267
|
+
expect(helper.get_puppet_install_info[:puppet_install_type]).to eq('pe')
|
|
268
|
+
end
|
|
269
|
+
|
|
225
270
|
it 'extracts info from PUPPET_INSTALL_TYPE' do
|
|
226
271
|
ENV['PUPPET_INSTALL_TYPE'] = 'pe'
|
|
227
272
|
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simp-beaker-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Tessmer
|
|
8
8
|
- Trevor Vaughan
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2026-06-25 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: beaker
|
|
@@ -165,6 +164,26 @@ dependencies:
|
|
|
165
164
|
- - "~>"
|
|
166
165
|
- !ruby/object:Gem::Version
|
|
167
166
|
version: '1.8'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: puppet_fixtures
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0.1'
|
|
174
|
+
- - "<"
|
|
175
|
+
- !ruby/object:Gem::Version
|
|
176
|
+
version: 3.0.0
|
|
177
|
+
type: :runtime
|
|
178
|
+
prerelease: false
|
|
179
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
180
|
+
requirements:
|
|
181
|
+
- - ">="
|
|
182
|
+
- !ruby/object:Gem::Version
|
|
183
|
+
version: '0.1'
|
|
184
|
+
- - "<"
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: 3.0.0
|
|
168
187
|
description: 'Beaker helper methods to help scaffold SIMP acceptance tests
|
|
169
188
|
|
|
170
189
|
'
|
|
@@ -181,7 +200,6 @@ files:
|
|
|
181
200
|
- ".github/workflows/pr_tests.yml"
|
|
182
201
|
- ".github/workflows/tag_deploy_rubygem.yml"
|
|
183
202
|
- ".gitignore"
|
|
184
|
-
- ".gitlab-ci.yml"
|
|
185
203
|
- ".rspec"
|
|
186
204
|
- ".rubocop.yml"
|
|
187
205
|
- CHANGELOG.md
|
|
@@ -198,7 +216,6 @@ files:
|
|
|
198
216
|
- lib/simp/beaker_helpers/constants.rb
|
|
199
217
|
- lib/simp/beaker_helpers/inspec.rb
|
|
200
218
|
- lib/simp/beaker_helpers/snapshot.rb
|
|
201
|
-
- lib/simp/beaker_helpers/ssg.rb
|
|
202
219
|
- lib/simp/beaker_helpers/version.rb
|
|
203
220
|
- lib/simp/beaker_helpers/windows.rb
|
|
204
221
|
- lib/simp/rake/beaker.rb
|
|
@@ -231,9 +248,6 @@ files:
|
|
|
231
248
|
- spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
|
|
232
249
|
- spec/acceptance/suites/snapshot/10_general_usage_spec.rb
|
|
233
250
|
- spec/acceptance/suites/snapshot/nodesets
|
|
234
|
-
- spec/acceptance/suites/ssg/00_default_spec.rb
|
|
235
|
-
- spec/acceptance/suites/ssg/metadata.yml
|
|
236
|
-
- spec/acceptance/suites/ssg/nodesets
|
|
237
251
|
- spec/acceptance/suites/windows/00_default_spec.rb
|
|
238
252
|
- spec/acceptance/suites/windows/metadata.yml
|
|
239
253
|
- spec/acceptance/suites/windows/nodesets/default.yml
|
|
@@ -251,7 +265,6 @@ licenses:
|
|
|
251
265
|
- Apache-2.0
|
|
252
266
|
metadata:
|
|
253
267
|
issue_tracker: https://github.com/simp/rubygem-simp-beaker-helpers/issues
|
|
254
|
-
post_install_message:
|
|
255
268
|
rdoc_options: []
|
|
256
269
|
require_paths:
|
|
257
270
|
- lib
|
|
@@ -266,8 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
266
279
|
- !ruby/object:Gem::Version
|
|
267
280
|
version: '0'
|
|
268
281
|
requirements: []
|
|
269
|
-
rubygems_version:
|
|
270
|
-
signing_key:
|
|
282
|
+
rubygems_version: 4.0.10
|
|
271
283
|
specification_version: 4
|
|
272
284
|
summary: beaker helper methods for SIMP
|
|
273
285
|
test_files: []
|
data/.gitlab-ci.yml
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
# ------------------------------------------------------------------------------
|
|
2
|
-
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
|
|
3
|
-
#
|
|
4
|
-
# https://puppet.com/docs/pe/2019.8/component_versions_in_recent_pe_releases.html
|
|
5
|
-
# https://puppet.com/misc/puppet-enterprise-lifecycle
|
|
6
|
-
# ------------------------------------------------------------------------------
|
|
7
|
-
# Release Puppet Ruby EOL
|
|
8
|
-
# PE 2021.7 7.24 2.7.7 LTS EOS: 2024-08 EOL: 2025-02
|
|
9
|
-
# PE 2023.Y 7.24 2.7.7 Biannual updates
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
stages:
|
|
13
|
-
- 'validation'
|
|
14
|
-
- 'acceptance'
|
|
15
|
-
- 'compliance'
|
|
16
|
-
- 'deployment'
|
|
17
|
-
|
|
18
|
-
variables:
|
|
19
|
-
# PUPPET_VERSION is a canary variable!
|
|
20
|
-
#
|
|
21
|
-
# The value `UNDEFINED` will (intentionally) cause `bundler install|update` to
|
|
22
|
-
# fail. The intended value for PUPPET_VERSION is provided by the `pup_#` YAML
|
|
23
|
-
# anchors. If it is still `UNDEFINED`, all the other setting from the job's
|
|
24
|
-
# anchor are also missing.
|
|
25
|
-
PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
|
|
26
|
-
BUNDLER_VERSION: '2.2.19'
|
|
27
|
-
SIMP_MATRIX_LEVEL: '1'
|
|
28
|
-
SIMP_FORCE_RUN_MATRIX: 'no'
|
|
29
|
-
|
|
30
|
-
# Force dependencies into a path the gitlab-runner user can write to.
|
|
31
|
-
# (This avoids some failures on Runners with misconfigured ruby environments.)
|
|
32
|
-
GEM_HOME: .vendor/gem_install
|
|
33
|
-
BUNDLE_CACHE_PATH: .vendor/bundle
|
|
34
|
-
BUNDLE_PATH: .vendor/bundle
|
|
35
|
-
BUNDLE_BIN: .vendor/gem_install/bin
|
|
36
|
-
BUNDLE_NO_PRUNE: 'true'
|
|
37
|
-
|
|
38
|
-
.snippets:
|
|
39
|
-
before_beaker_google:
|
|
40
|
-
# Logic for beaker-google environments
|
|
41
|
-
- echo -e "\e[0Ksection_start:`date +%s`:before_script05[collapsed=true]\r\e[0KGCP environment checks"
|
|
42
|
-
- "if [ \"$BEAKER_HYPERVISOR\" == google ]; then mkdir -p ~/.ssh; chmod 700 ~/.ssh; test -f ~/.ssh/google_compute_engine || ssh-keygen -f ~/.ssh/google_compute_engine < /dev/null; echo 'gem \"beaker-google\"' >> Gemfile.local ; fi"
|
|
43
|
-
- echo -e "\e[0Ksection_end:`date +%s`:before_script05\r\e[0K"
|
|
44
|
-
|
|
45
|
-
before:
|
|
46
|
-
# Print important environment variables that may affect this job
|
|
47
|
-
- 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX|GOOGLE/); pad=((e.map{|x| x.size}.max||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)" || :'
|
|
48
|
-
|
|
49
|
-
- echo -e "\e[0Ksection_start:`date +%s`:before_script10[collapsed=true]\r\e[0KDiagnostic ruby & gem information"
|
|
50
|
-
# Diagnostic ruby & gem information
|
|
51
|
-
- 'which ruby && ruby --version || :'
|
|
52
|
-
- "[[ $- == *i* ]] && echo 'Interactive shell session' || echo 'Non-interactive shell session'"
|
|
53
|
-
- "shopt -q login_shell && echo 'Login shell' || echo 'Not a login shell'"
|
|
54
|
-
- 'rvm ls || :'
|
|
55
|
-
- echo -e "\e[0Ksection_end:`date +%s`:before_script10\r\e[0K"
|
|
56
|
-
|
|
57
|
-
# If RVM is available, make SURE it's using the right Ruby:
|
|
58
|
-
# * Source rvm (to run in non-login shells)
|
|
59
|
-
# * If any $MATRIX_RUBY_VERSION rubies are available, use the latest
|
|
60
|
-
# * Otherwise: install & use ${MATRIX_RUBY_VERSION}-head (e.g., latest)
|
|
61
|
-
# * ^^ This could be wonky and introduce variations across runners
|
|
62
|
-
# * ^^ maybe it should just fail if there is no $MATRIX_RUBY_VERSION installed?
|
|
63
|
-
- "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; }"
|
|
64
|
-
- "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\" ; }"
|
|
65
|
-
- 'ruby --version || :'
|
|
66
|
-
- 'gem list sync || :'
|
|
67
|
-
- echo -e "\e[0Ksection_end:`date +%s`:before_script20\r\e[0K"
|
|
68
|
-
|
|
69
|
-
# Bundle gems (preferring cached > local > downloaded resources)
|
|
70
|
-
# * Try to use cached and local resources before downloading dependencies
|
|
71
|
-
- echo -e "\e[0Ksection_start:`date +%s`:before_script30[collapsed=true]\r\e[0KBundle gems (preferring cached > local > downloaded resources)"
|
|
72
|
-
- 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-2.2.6}")'
|
|
73
|
-
- 'declare GEM_INSTALL_CMD=(gem install --no-document)'
|
|
74
|
-
- 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
|
|
75
|
-
- 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
|
|
76
|
-
- 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
|
|
77
|
-
- 'rm -rf pkg/ || :'
|
|
78
|
-
- '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 ; }'
|
|
79
|
-
- echo -e "\e[0Ksection_end:`date +%s`:before_script30\r\e[0K"
|
|
80
|
-
|
|
81
|
-
# Diagnostic bundler, ruby, and gem checks:
|
|
82
|
-
- echo -e "\e[0Ksection_start:`date +%s`:before_script40[collapsed=true]\r\e[0KDiagnostic bundler, ruby, and gem checks"
|
|
83
|
-
- 'bundle exec rvm ls || :'
|
|
84
|
-
- 'bundle exec which ruby || :'
|
|
85
|
-
- 'bundle show sync || :'
|
|
86
|
-
- 'bundle exec gem list sync || :'
|
|
87
|
-
- echo -e "\e[0Ksection_end:`date +%s`:before_script40\r\e[0K"
|
|
88
|
-
|
|
89
|
-
# bundler dependencies and caching
|
|
90
|
-
#
|
|
91
|
-
# - Cache bundler gems between pipelines foreach Ruby version
|
|
92
|
-
# - Try to use cached and local resources before downloading dependencies
|
|
93
|
-
# --------------------------------------
|
|
94
|
-
.setup_bundler_env: &setup_bundler_env
|
|
95
|
-
cache:
|
|
96
|
-
key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
|
|
97
|
-
paths:
|
|
98
|
-
- '.vendor'
|
|
99
|
-
before_script:
|
|
100
|
-
!reference [.snippets, before]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
# Assign a matrix level when your test will run. Heavier jobs get higher numbers
|
|
104
|
-
# NOTE: To skip all jobs with a SIMP_MATRIX_LEVEL, set SIMP_MATRIX_LEVEL=0
|
|
105
|
-
# ------------------------------------------------------------------------------
|
|
106
|
-
|
|
107
|
-
.relevant_file_conditions_trigger_spec_tests: &relevant_file_conditions_trigger_spec_tests
|
|
108
|
-
changes:
|
|
109
|
-
- .gitlab-ci.yml
|
|
110
|
-
- .fixtures.yml
|
|
111
|
-
- .rspec
|
|
112
|
-
- metadata.json
|
|
113
|
-
- "spec/spec_helper.rb"
|
|
114
|
-
- "spec/{classes,unit,defines,type_aliases,types,hosts,lib}/**/*.rb"
|
|
115
|
-
- "{SIMP,data,manifests,files,types,lib}/**/*"
|
|
116
|
-
- "templates/**/*.{erb,epp}"
|
|
117
|
-
- "Gemfile"
|
|
118
|
-
exists:
|
|
119
|
-
- "spec/{classes,unit,defines,type_aliases,types,hosts,lib}/**/*_spec.rb"
|
|
120
|
-
|
|
121
|
-
.relevant_file_conditions_trigger_acceptance_tests: &relevant_file_conditions_trigger_acceptance_tests
|
|
122
|
-
changes:
|
|
123
|
-
- .gitlab-ci.yml
|
|
124
|
-
- .fixtures.yml
|
|
125
|
-
- "spec/spec_helper_acceptance.rb"
|
|
126
|
-
- "spec/acceptance/**/*"
|
|
127
|
-
- "{SIMP,data,manifests,files,types,lib}/**/*"
|
|
128
|
-
- "templates/**/*.{erb,epp}"
|
|
129
|
-
- "Gemfile"
|
|
130
|
-
exists:
|
|
131
|
-
- "spec/acceptance/**/*_spec.rb"
|
|
132
|
-
|
|
133
|
-
# For some reason, the rule regexes stopped matching line starts inside
|
|
134
|
-
# $CI_COMMIT_MESSAGE with carets /^/, so we're using /\n?/ as a workaround.
|
|
135
|
-
.skip_job_when_commit_message_says_to: &skip_job_when_commit_message_says_to
|
|
136
|
-
if: '$CI_COMMIT_MESSAGE =~ /\n?CI: (SKIP MATRIX|MATRIX LEVEL 0)/'
|
|
137
|
-
when: never
|
|
138
|
-
|
|
139
|
-
.force_run_job_when_commit_message_lvl_1_or_above: &force_run_job_when_commit_mssage_lvl_1_or_above
|
|
140
|
-
if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [123]/'
|
|
141
|
-
when: on_success
|
|
142
|
-
|
|
143
|
-
.force_run_job_when_commit_message_lvl_2_or_above: &force_run_job_when_commit_mssage_lvl_2_or_above
|
|
144
|
-
if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [23]/'
|
|
145
|
-
when: on_success
|
|
146
|
-
|
|
147
|
-
.force_run_job_when_commit_message_lvl_3_or_above: &force_run_job_when_commit_mssage_lvl_3_or_above
|
|
148
|
-
if: '$CI_COMMIT_MESSAGE =~ /\n?CI: MATRIX LEVEL [3]/'
|
|
149
|
-
when: on_success
|
|
150
|
-
|
|
151
|
-
# check for $CI_PIPELINE_SOURCE needed because this is combined w/when:changes
|
|
152
|
-
.run_job_when_level_1_or_above_w_changes: &run_job_when_level_1_or_above_w_changes
|
|
153
|
-
if: '$SIMP_MATRIX_LEVEL =~ /^[123]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
|
|
154
|
-
when: on_success
|
|
155
|
-
|
|
156
|
-
.run_job_when_level_2_or_above_w_changes: &run_job_when_level_2_or_above_w_changes
|
|
157
|
-
if: '$SIMP_MATRIX_LEVEL =~ /^[23]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
|
|
158
|
-
when: on_success
|
|
159
|
-
|
|
160
|
-
.run_job_when_level_3_or_above_w_changes: &run_job_when_level_3_or_above_w_changes
|
|
161
|
-
if: '$SIMP_MATRIX_LEVEL =~ /^[3]$/ && $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
|
|
162
|
-
when: on_success
|
|
163
|
-
|
|
164
|
-
.force_run_job_when_var_and_lvl_1_or_above: &force_run_job_when_var_and_lvl_1_or_above
|
|
165
|
-
if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[123]$/'
|
|
166
|
-
when: on_success
|
|
167
|
-
|
|
168
|
-
.force_run_job_when_var_and_lvl_2_or_above: &force_run_job_when_var_and_lvl_2_or_above
|
|
169
|
-
if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[23]$/'
|
|
170
|
-
when: on_success
|
|
171
|
-
|
|
172
|
-
.force_run_job_when_var_and_lvl_3_or_above: &force_run_job_when_var_and_lvl_3_or_above
|
|
173
|
-
if: '$SIMP_FORCE_RUN_MATRIX == "yes" && $SIMP_MATRIX_LEVEL =~ /^[3]$/'
|
|
174
|
-
when: on_success
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
# SIMP_MATRIX_LEVEL=1: Intended to run every commit
|
|
179
|
-
.with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
|
|
180
|
-
rules:
|
|
181
|
-
- <<: *skip_job_when_commit_message_says_to
|
|
182
|
-
- <<: *force_run_job_when_var_and_lvl_1_or_above
|
|
183
|
-
- <<: *force_run_job_when_commit_mssage_lvl_1_or_above
|
|
184
|
-
- <<: *run_job_when_level_1_or_above_w_changes
|
|
185
|
-
<<: *relevant_file_conditions_trigger_acceptance_tests
|
|
186
|
-
- when: never
|
|
187
|
-
|
|
188
|
-
.with_SIMP_SPEC_MATRIX_LEVEL_1: &with_SIMP_SPEC_MATRIX_LEVEL_1
|
|
189
|
-
rules:
|
|
190
|
-
- <<: *skip_job_when_commit_message_says_to
|
|
191
|
-
- <<: *force_run_job_when_commit_mssage_lvl_1_or_above
|
|
192
|
-
- <<: *force_run_job_when_var_and_lvl_1_or_above
|
|
193
|
-
- <<: *run_job_when_level_1_or_above_w_changes
|
|
194
|
-
<<: *relevant_file_conditions_trigger_spec_tests
|
|
195
|
-
- when: never
|
|
196
|
-
|
|
197
|
-
# SIMP_MATRIX_LEVEL=2: Resource-heavy or redundant jobs
|
|
198
|
-
.with_SIMP_ACCEPTANCE_MATRIX_LEVEL_2: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_2
|
|
199
|
-
rules:
|
|
200
|
-
- <<: *skip_job_when_commit_message_says_to
|
|
201
|
-
- <<: *force_run_job_when_var_and_lvl_2_or_above
|
|
202
|
-
- <<: *force_run_job_when_commit_mssage_lvl_2_or_above
|
|
203
|
-
- <<: *run_job_when_level_2_or_above_w_changes
|
|
204
|
-
<<: *relevant_file_conditions_trigger_acceptance_tests
|
|
205
|
-
- when: never
|
|
206
|
-
|
|
207
|
-
.with_SIMP_SPEC_MATRIX_LEVEL_2: &with_SIMP_SPEC_MATRIX_LEVEL_2
|
|
208
|
-
rules:
|
|
209
|
-
- <<: *skip_job_when_commit_message_says_to
|
|
210
|
-
- <<: *force_run_job_when_commit_mssage_lvl_2_or_above
|
|
211
|
-
- <<: *force_run_job_when_var_and_lvl_2_or_above
|
|
212
|
-
- <<: *run_job_when_level_2_or_above_w_changes
|
|
213
|
-
<<: *relevant_file_conditions_trigger_spec_tests
|
|
214
|
-
- when: never
|
|
215
|
-
|
|
216
|
-
# SIMP_MATRIX_LEVEL=3: Reserved for FULL matrix testing
|
|
217
|
-
.with_SIMP_ACCEPTANCE_MATRIX_LEVEL_3: &with_SIMP_ACCEPTANCE_MATRIX_LEVEL_3
|
|
218
|
-
rules:
|
|
219
|
-
- <<: *skip_job_when_commit_message_says_to
|
|
220
|
-
- <<: *force_run_job_when_var_and_lvl_3_or_above
|
|
221
|
-
- <<: *force_run_job_when_commit_mssage_lvl_3_or_above
|
|
222
|
-
- <<: *run_job_when_level_3_or_above_w_changes
|
|
223
|
-
<<: *relevant_file_conditions_trigger_acceptance_tests
|
|
224
|
-
- when: never
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
# Puppet Versions
|
|
228
|
-
#-----------------------------------------------------------------------
|
|
229
|
-
|
|
230
|
-
.pup_7_x: &pup_7_x
|
|
231
|
-
image: 'ruby:2.7'
|
|
232
|
-
variables:
|
|
233
|
-
PUPPET_VERSION: '~> 7.0'
|
|
234
|
-
BEAKER_PUPPET_COLLECTION: 'puppet7'
|
|
235
|
-
MATRIX_RUBY_VERSION: '2.7'
|
|
236
|
-
|
|
237
|
-
.pup_8_x: &pup_8_x
|
|
238
|
-
image: 'ruby:3.2'
|
|
239
|
-
variables:
|
|
240
|
-
PUPPET_VERSION: '~> 8.0'
|
|
241
|
-
BEAKER_PUPPET_COLLECTION: 'puppet8'
|
|
242
|
-
MATRIX_RUBY_VERSION: '3.2'
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
# Testing Environments
|
|
246
|
-
#-----------------------------------------------------------------------
|
|
247
|
-
|
|
248
|
-
.lint_tests: &lint_tests
|
|
249
|
-
stage: 'validation'
|
|
250
|
-
tags: ['docker']
|
|
251
|
-
<<: *setup_bundler_env
|
|
252
|
-
script:
|
|
253
|
-
- 'bundle exec rake syntax'
|
|
254
|
-
- 'bundle exec rake lint'
|
|
255
|
-
- 'bundle exec rake metadata_lint'
|
|
256
|
-
|
|
257
|
-
.unit_tests: &unit_tests
|
|
258
|
-
stage: 'validation'
|
|
259
|
-
tags: ['docker']
|
|
260
|
-
<<: *setup_bundler_env
|
|
261
|
-
<<: *with_SIMP_SPEC_MATRIX_LEVEL_1
|
|
262
|
-
script:
|
|
263
|
-
- 'bundle exec rake spec'
|
|
264
|
-
|
|
265
|
-
.beaker: &beaker
|
|
266
|
-
image: ruby:2.7.8 # must be 2.7.2 if running in GCP
|
|
267
|
-
tags:
|
|
268
|
-
- beaker
|
|
269
|
-
before_script:
|
|
270
|
-
- !reference [.snippets, before_beaker_google]
|
|
271
|
-
- !reference [.snippets, before]
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
.acceptance_base: &acceptance_base
|
|
276
|
-
stage: 'acceptance'
|
|
277
|
-
<<: *setup_bundler_env
|
|
278
|
-
<<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
|
|
279
|
-
<<: *beaker
|
|
280
|
-
|
|
281
|
-
.compliance_base: &compliance_base
|
|
282
|
-
stage: 'compliance'
|
|
283
|
-
<<: *setup_bundler_env
|
|
284
|
-
<<: *with_SIMP_ACCEPTANCE_MATRIX_LEVEL_1
|
|
285
|
-
<<: *beaker
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
# Unit Tests
|
|
289
|
-
#-----------------------------------------------------------------------
|
|
290
|
-
|
|
291
|
-
pup7.x-unit:
|
|
292
|
-
<<: *pup_7_x
|
|
293
|
-
<<: *unit_tests
|
|
294
|
-
|
|
295
|
-
pup8.x-unit:
|
|
296
|
-
<<: *pup_8_x
|
|
297
|
-
<<: *unit_tests
|
|
298
|
-
|
|
299
|
-
# Repo-specific content
|
|
300
|
-
# ==============================================================================
|
|
301
|
-
|
|
302
|
-
#=======================================================================
|
|
303
|
-
# Packaging test
|
|
304
|
-
|
|
305
|
-
pup7.x-pkg:
|
|
306
|
-
<<: *pup_7_x
|
|
307
|
-
<<: *unit_tests
|
|
308
|
-
script:
|
|
309
|
-
'bundle exec rake pkg:gem'
|
|
310
|
-
|
|
311
|
-
pup8.x-pkg:
|
|
312
|
-
<<: *pup_8_x
|
|
313
|
-
<<: *unit_tests
|
|
314
|
-
script:
|
|
315
|
-
'bundle exec rake pkg:gem'
|
|
316
|
-
|
|
317
|
-
#=======================================================================
|
|
318
|
-
# Acceptance tests
|
|
319
|
-
|
|
320
|
-
# Verify a suite fails when an explicitly-specified nodeset does not exist.
|
|
321
|
-
# It is significantly quicker to test here (where rvm is already installed
|
|
322
|
-
# and the bundle is configured with this version of simp-beaker-helpers)
|
|
323
|
-
# than in an acceptance test with a build user.
|
|
324
|
-
default-bad-nodeset:
|
|
325
|
-
<<: *pup_8_x
|
|
326
|
-
<<: *acceptance_base
|
|
327
|
-
script:
|
|
328
|
-
- 'RESULT=`bundle exec rake beaker:suites[default,oops] 1>/dev/null; echo $?`; (test $RESULT == "1")'
|
|
329
|
-
- echo 'beaker:suites correctly failed with unknown nodeset'
|
|
330
|
-
|
|
331
|
-
default:
|
|
332
|
-
<<: *pup_8_x
|
|
333
|
-
<<: *acceptance_base
|
|
334
|
-
script:
|
|
335
|
-
- bundle exec rake beaker:suites[default]
|
|
336
|
-
|
|
337
|
-
default-amzn2:
|
|
338
|
-
<<: *pup_8_x
|
|
339
|
-
<<: *acceptance_base
|
|
340
|
-
script:
|
|
341
|
-
- bundle exec rake beaker:suites[default,amzn2]
|
|
342
|
-
|
|
343
|
-
default-fips:
|
|
344
|
-
<<: *pup_8_x
|
|
345
|
-
<<: *acceptance_base
|
|
346
|
-
script:
|
|
347
|
-
- BEAKER_fips=yes bundle exec rake beaker:suites[default]
|
|
348
|
-
|
|
349
|
-
fips_from_fixtures:
|
|
350
|
-
<<: *pup_8_x
|
|
351
|
-
<<: *acceptance_base
|
|
352
|
-
script:
|
|
353
|
-
- bundle exec rake beaker:suites[fips_from_fixtures]
|
|
354
|
-
|
|
355
|
-
puppet8_collections:
|
|
356
|
-
<<: *pup_8_x
|
|
357
|
-
<<: *acceptance_base
|
|
358
|
-
script:
|
|
359
|
-
- bundle exec rake beaker:suites[puppet_collections]
|
|
360
|
-
|
|
361
|
-
puppet7_collections:
|
|
362
|
-
<<: *pup_7_x
|
|
363
|
-
<<: *acceptance_base
|
|
364
|
-
script:
|
|
365
|
-
- bundle exec rake beaker:suites[puppet_collections]
|
|
366
|
-
|
|
367
|
-
oel_ssg:
|
|
368
|
-
<<: *pup_8_x
|
|
369
|
-
<<: *acceptance_base
|
|
370
|
-
script:
|
|
371
|
-
- bundle exec rake beaker:suites[ssg,oel]
|
|
372
|
-
|
|
373
|
-
windows:
|
|
374
|
-
<<: *pup_8_x
|
|
375
|
-
<<: *acceptance_base
|
|
376
|
-
allow_failure: true
|
|
377
|
-
script:
|
|
378
|
-
- bundle exec rake beaker:suites[windows]
|
|
379
|
-
|
|
380
|
-
snapshot:
|
|
381
|
-
<<: *pup_8_x
|
|
382
|
-
<<: *acceptance_base
|
|
383
|
-
# This is prone to breakage in the underlying system
|
|
384
|
-
allow_failure: true
|
|
385
|
-
script:
|
|
386
|
-
- BEAKER_simp_snapshot=yes bundle exec rake beaker:suites[snapshot]
|