Skip to content

Commit 933ea2f

Browse files
authored
Merge pull request #783 from puppetlabs/task_spec_puppet7_puppet8
(PA-7433) Update task_spec to upgrade from puppet7 to latest puppet8 dev build
2 parents 5db87f4 + 94c347d commit 933ea2f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/task_acceptance_tests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222

2323
runs-on: 'ubuntu-latest'
2424
steps:
25+
26+
- name: Connect to Twingate
27+
uses: twingate/github-action@v1
28+
with:
29+
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}
30+
2531
- name: Checkout current PR code
2632
uses: actions/checkout@v4
2733

task_spec/spec/acceptance/init_spec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def latest_sources
123123
end
124124

125125
puppet_7_collection = 'puppet7'
126-
puppet_8_collection = 'puppet8'
127126

128127
# We can only test puppet 7 -> 7 upgrades if multiple Puppet releases
129128
# have supported a given platform.
@@ -162,6 +161,7 @@ def latest_sources
162161
expect(res['value']['version']).to eq(puppet_7_version)
163162
end
164163
expect(res['value']['source']).to be
164+
logger.info("Successfully installed puppet-agent version: #{res['value']['version']}")
165165
end
166166

167167
# Check that puppet agent service has been stopped due to 'stop_service' parameter set to true
@@ -175,7 +175,7 @@ def latest_sources
175175

176176
# Try to upgrade with no specific version given in parameter
177177
# Expect nothing to happen and receive a message regarding this
178-
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_8_collection })
178+
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet8-nightly' }.merge(latest_sources))
179179

180180
results.each do |result|
181181
logger.info("Ensuring installed puppet-agent on #{result['target']}: #{result['status']}")
@@ -220,6 +220,7 @@ def latest_sources
220220
expect(res['value']['version']).not_to eq(puppet_7_version)
221221
expect(res['value']['version']).to match(%r{^7\.\d+\.\d+})
222222
expect(res['value']['source']).to be
223+
logger.info("Successfully upgraded to puppet7 latest version: #{res['value']['version']}")
223224
end
224225
end
225226

@@ -239,8 +240,8 @@ def latest_sources
239240
end
240241

241242
# Succesfully upgrade from puppet7 to puppet8
242-
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_8_collection, 'version' => 'latest' })
243-
243+
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet8-nightly',
244+
'version' => 'latest' }.merge(latest_sources))
244245
results.each do |result|
245246
logger.info("Upgraded puppet-agent to puppet8 on #{result['target']}: #{result['status']}")
246247
log_output_errors(result)
@@ -257,12 +258,13 @@ def latest_sources
257258
expect(installed_version).not_to match(%r{^7\.\d+\.\d+})
258259
expect(installed_version).to match(%r{^8\.\d+\.\d+})
259260
expect(res['value']['source']).to be
261+
logger.info("Successfully upgraded to puppet8 latest version: #{res['value']['version']}")
260262
end
261263

262264
# Try installing the same version again
263265
# Expect nothing to happen and receive a message regarding this
264-
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_8_collection, 'version' => installed_version })
265-
266+
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet8-nightly',
267+
'version' => installed_version }.merge(latest_sources))
266268
results.each do |res|
267269
expect(res).to include('status' => 'success')
268270
expect(res['value']['_output']).to match(%r{Puppet Agent #{installed_version} detected. Nothing to do.})

0 commit comments

Comments
 (0)