Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -61,7 +61,7 @@
}
end

it 'works with version and install tasks' do

Check failure on line 64 in task_spec/spec/acceptance/init_spec.rb

View workflow job for this annotation

GitHub Actions / On ubuntu-20.04

install task works with version and install tasks Failure/Error: expect(results).to all(include('status' => 'success')) expected [***"action" => "task", "object" => "puppet_agent::install", "status" => "failure", "target" => "127.0.0.1?n=ub...le-Fetch/python3/apt-helper is found\n17:40:51 +0000 CRIT: Unable to retrieve a valid package!\n"***] to all include ***"status" => "success"*** object at index 0 failed to match: expected ***"action" => "task", "object" => "puppet_agent::install", "status" => "failure", "target" => "127.0.0.1?n=ubu...ile-Fetch/python3/apt-helper is found\n17:40:51 +0000 CRIT: Unable to retrieve a valid package!\n"*** to include ***"status" => "success"***
case target_platform
when latest_platform_list
# Here we only install puppet-agent 8.x from nightlies as we don't support 7.x
Expand Down Expand Up @@ -123,7 +123,6 @@
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 @@ -162,6 +161,7 @@
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 @@ -175,7 +175,7 @@

# 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 @@ -220,6 +220,7 @@
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 @@ -239,8 +240,8 @@
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 @@ -257,12 +258,13 @@
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