Skip to content

(PA-7433) Update task_spec to upgrade from puppet7 to latest puppet8 dev build #781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/task_acceptance_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:

runs-on: 'ubuntu-latest'
steps:

- name: Connect to Twingate
uses: twingate/github-action@v1
with:
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}

- name: Checkout current PR code
uses: actions/checkout@v4

Expand Down
14 changes: 8 additions & 6 deletions task_spec/spec/acceptance/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def latest_sources
end

puppet_7_collection = 'puppet7'
puppet_8_collection = 'puppet8'

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

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

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

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

Expand All @@ -238,8 +239,8 @@ def latest_sources
end

# Succesfully upgrade from puppet7 to puppet8
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_8_collection, 'version' => 'latest' })

results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet8-nightly',
'version' => 'latest' }.merge(latest_sources))
results.each do |result|
logger.info("Upgraded puppet-agent to puppet8 on #{result['target']}: #{result['status']}")
log_output_errors(result)
Expand All @@ -256,12 +257,13 @@ def latest_sources
expect(installed_version).not_to match(%r{^7\.\d+\.\d+})
expect(installed_version).to match(%r{^8\.\d+\.\d+})
expect(res['value']['source']).to be
logger.info("Successfully upgraded to puppet8 latest version: #{res['value']['version']}")
end

# Try installing the same version again
# Expect nothing to happen and receive a message regarding this
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_8_collection, 'version' => installed_version })

results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet8-nightly',
'version' => installed_version }.merge(latest_sources))
results.each do |res|
expect(res).to include('status' => 'success')
expect(res['value']['_output']).to match(%r{Puppet Agent #{installed_version} detected. Nothing to do.})
Expand Down
Loading