Skip to content

Commit 2c0f99a

Browse files
committed
(PA-7433) Update task_spec to upgrade from puppet7 to latest puppet8 dev build
Previously, the puppet_agent::install task to install or upgrade to puppet8 used puppet8 builds from downloads.puppet.com. Since puppet8 builds are no longer published there, this commit updates the puppet_agent::install task to install or upgrade to puppet8 using the puppet8 dev builds from Artifactory instead. This commit also adds some logger.info statements so it's easier to track what specific version of puppet-agent is being upgraded to or installed. Also, it adds a step in the task acceptance tests workflow to connect to Twingate so that workflow can access Artifactory.
1 parent de4dedc commit 2c0f99a

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
@@ -122,7 +122,6 @@ def latest_sources
122122
end
123123

124124
puppet_7_collection = 'puppet7'
125-
puppet_8_collection = 'puppet8'
126125

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

166166
# Check that puppet agent service has been stopped due to 'stop_service' parameter set to true
@@ -174,7 +174,7 @@ def latest_sources
174174

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

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

@@ -238,8 +239,8 @@ def latest_sources
238239
end
239240

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

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

0 commit comments

Comments
 (0)