Skip to content

Commit

Permalink
Merge pull request #560 from h0tw1r3/amazon-support
Browse files Browse the repository at this point in the history
add amazonlinux litmus images to matrix
  • Loading branch information
david22swan authored May 1, 2024
2 parents 0de4b09 + 133b5e2 commit 6bb2d5c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions exe/matrix_from_metadata_v2
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ ARM_IMAGE_TABLE = {
}.freeze

DOCKER_PLATFORMS = {
'AmazonLinux-2' => 'litmusimage/amazonlinux:2',
'AmazonLinux-2023' => 'litmusimage/amazonlinux:2023',
'CentOS-7' => 'litmusimage/centos:7',
'CentOS-8' => 'litmusimage/centos:stream8', # Support officaly moved to Stream8, metadata is being left as is
'CentOS-9' => 'litmusimage/centos:stream9',
Expand Down
7 changes: 7 additions & 0 deletions spec/exe/fake_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
}
],
"operatingsystem_support": [
{
"operatingsystem": "AmazonLinux",
"operatingsystemrelease": [
"2",
"2023"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
Expand Down
10 changes: 7 additions & 3 deletions spec/exe/matrix_from_metadata_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
[
'matrix={',
'"platforms":[',
'{"label":"AmazonLinux-2","provider":"docker","image":"litmusimage/amazonlinux:2"},',
'{"label":"AmazonLinux-2023","provider":"docker","image":"litmusimage/amazonlinux:2023"},',
'{"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"},',
Expand All @@ -39,7 +41,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 14 cells:\n - Acceptance Test Cells: 12\n - Spec Test Cells: 2")
expect(result.stdout).to include("Created matrix with 18 cells:\n - Acceptance Test Cells: 16\n - Spec Test Cells: 2")
end
end

Expand All @@ -64,6 +66,8 @@
[
'matrix={',
'"platforms":[',
'{"label":"AmazonLinux-2","provider":"docker","image":"litmusimage/amazonlinux:2"},',
'{"label":"AmazonLinux-2023","provider":"docker","image":"litmusimage/amazonlinux:2023"},',
'{"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"},',
Expand All @@ -79,14 +83,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 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

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', 'ubuntu-22.04', 'redhat-8', 'redhat-9'] }) }
let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['amazonlinux-2', 'amazonlinux-2023', 'ubuntu-18.04', 'ubuntu-22.04', 'redhat-8', 'redhat-9'] }) }

before do
ENV['GITHUB_OUTPUT'] = github_output.path
Expand Down

0 comments on commit 6bb2d5c

Please sign in to comment.