Skip to content

Commit

Permalink
(CAT-1522) - Adding support for Ubuntu 22.04 ARM OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramesh7 committed Dec 20, 2023
1 parent c918dad commit aa4daa8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion exe/matrix_from_metadata_v2
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ IMAGE_TABLE = {
}.freeze

ARM_IMAGE_TABLE = {
'RedHat-9-arm' => 'rhel-9-arm64'
'RedHat-9-arm' => 'rhel-9-arm64',
'Ubuntu-22.04-arm' => 'ubuntu-2204-lts-arm64'
}.freeze

DOCKER_PLATFORMS = {
Expand Down
3 changes: 2 additions & 1 deletion spec/exe/fake_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"18.04"
"18.04",
"22.04"
]
}
],
Expand Down
15 changes: 10 additions & 5 deletions spec/exe/matrix_from_metadata_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
'{"label":"RedHat-9","provider":"provision_service","image":"rhel-9"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
'{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"}',
'{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"},',
'{"label":"Ubuntu-22.04","provider":"docker","image":"litmusimage/ubuntu:22.04"},',
'{"label":"Ubuntu-22.04-arm","provider":"provision_service","image":"ubuntu-2204-lts-arm64"}',
'],',
'"collection":[',
'"puppet7-nightly","puppet8-nightly"',
Expand All @@ -37,7 +39,7 @@
expect(github_output_content).to include(
'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
)
expect(result.stdout).to include("Created matrix with 12 cells:\n - Acceptance Test Cells: 10\n - Spec Test Cells: 2")
expect(result.stdout).to include("Created matrix with 16 cells:\n - Acceptance Test Cells: 14\n - Spec Test Cells: 2")
end
end

Expand All @@ -64,7 +66,9 @@
'{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
'{"label":"RedHat-9","provider":"provision_service","image":"rhel-9"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
'{"label":"Ubuntu-22.04","provider":"docker","image":"litmusimage/ubuntu:22.04"},',
'{"label":"Ubuntu-22.04-arm","provider":"provision_service","image":"ubuntu-2204-lts-arm64"}',
'],',
'"collection":[',
'"puppet7-nightly","puppet8-nightly"',
Expand All @@ -75,14 +79,14 @@
expect(github_output_content).to include(
'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
)
expect(result.stdout).to include("Created matrix with 10 cells:\n - Acceptance Test Cells: 8\n - Spec Test Cells: 2")
expect(result.stdout).to include("Created matrix with 14 cells:\n - Acceptance Test Cells: 12\n - Spec Test Cells: 2")
end
end

context 'with --exclude-platforms \'["ubuntu-18.04","redhat-8"]\'' do
let(:github_output) { Tempfile.new('github_output') }
let(:github_output_content) { github_output.read }
let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04', 'redhat-8', 'redhat-9'] }) }
let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04', 'ubuntu-22.04', 'ubuntu-22.04-arm', 'redhat-8', 'redhat-9'] }) }

before do
ENV['GITHUB_OUTPUT'] = github_output.path
Expand All @@ -95,6 +99,7 @@
it 'generates the matrix without excluded platforms' do

Check failure on line 99 in spec/exe/matrix_from_metadata_v2_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 2.7) / spec

RSpec/ExampleLength: Example has too many lines. [21/20]

Check failure on line 99 in spec/exe/matrix_from_metadata_v2_spec.rb

View workflow job for this annotation

GitHub Actions / spec (ruby 3.2) / spec

RSpec/ExampleLength: Example has too many lines. [21/20]
expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
expect(result.stdout).to include('::warning::Ubuntu-18.04 was excluded from testing')
expect(result.stdout).to include('::warning::Ubuntu-22.04 was excluded from testing')
expect(result.stdout).to include('::warning::RedHat-8 was excluded from testing')
expect(github_output_content).to include(
[
Expand Down

0 comments on commit aa4daa8

Please sign in to comment.