From 133b5e2d0580c33d75f93782c9b7fb8f8345e0d4 Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Wed, 1 May 2024 01:21:24 -0500 Subject: [PATCH] (maint) add amazonlinux litmus images to matrix --- exe/matrix_from_metadata_v2 | 2 ++ spec/exe/fake_metadata.json | 7 +++++++ spec/exe/matrix_from_metadata_v2_spec.rb | 10 +++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/exe/matrix_from_metadata_v2 b/exe/matrix_from_metadata_v2 index a14d81f..c7c89ab 100755 --- a/exe/matrix_from_metadata_v2 +++ b/exe/matrix_from_metadata_v2 @@ -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 'Rocky-8' => 'litmusimage/rockylinux:8', diff --git a/spec/exe/fake_metadata.json b/spec/exe/fake_metadata.json index e599e5f..5b85997 100644 --- a/spec/exe/fake_metadata.json +++ b/spec/exe/fake_metadata.json @@ -14,6 +14,13 @@ } ], "operatingsystem_support": [ + { + "operatingsystem": "AmazonLinux", + "operatingsystemrelease": [ + "2", + "2023" + ] + }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ diff --git a/spec/exe/matrix_from_metadata_v2_spec.rb b/spec/exe/matrix_from_metadata_v2_spec.rb index ae6f1d8..b439468 100644 --- a/spec/exe/matrix_from_metadata_v2_spec.rb +++ b/spec/exe/matrix_from_metadata_v2_spec.rb @@ -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"},', @@ -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 @@ -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"},', @@ -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