puppet_litmus 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1369a1f849915e1d1f26f7fd67a08c7700a234311387ba5a26ce5e226da81cd
4
- data.tar.gz: 0aacb018ffc6bdfa148c36d48e58402fe761b5669ca61f19e7095f9c5ff5fd94
3
+ metadata.gz: 9ccf17917e989f2e0396f8b0611dd22cdf714b1e72db8be39e44b796e29e6044
4
+ data.tar.gz: fffb9cd11af3950794c48b23767e4990a278d4c9f2584497d432157b7c1cc031
5
5
  SHA512:
6
- metadata.gz: 7654e71c9f39deb9f9dc51cb9a0ecca43b4f60d7b1f0175088ab647f72cb9d3c257f9e4a914af97fdfc050d02804c8534d325530cfd53d8eb4e2569d0b8a8732
7
- data.tar.gz: d9786867d3db6c028bf8f41dd9f23c8f680104656deba2016d3c29d52dfba7b077c4428cadbda9b26a547b85077deca8fca8343d8d7b202d4517ea1eb4e8276a
6
+ metadata.gz: 11a2e60e31f2e4d830a1bb12ca1a872e184244852514913636edbc599489e8f5d3c94feb8c98d2166358ebba18a04e76daa4cefefda52c21cecc9306d6f18c1c
7
+ data.tar.gz: 455dfdd8692055f23f79c916c0968cfd2a16d7ce7d13ea1c74b5ce8b8b83fa25ae346c4928b1fdb355cca1cdb18790beab89b57302d9f6b7f64c42bf4165c6fa
data/README.md CHANGED
@@ -59,7 +59,7 @@ In order to use this new functionality, run:
59
59
 
60
60
  `$: bundle exec matrix_from_metadata_v2 --custom-matrix matrix.json`
61
61
 
62
- > Note: The file should contain a valid Array of JSON Objects (i.e. `[{"label":"AlmaLinux-8","provider":"provision_service","image":"almalinux-cloud/almalinux-8"}, {..}]`), otherwise it will throw an error.
62
+ > Note: The file should contain a valid Array of JSON Objects (i.e. see [here](https://github.com/puppetlabs/puppet_litmus/blob/main/docs/custom_matrix.json)), otherwise it will throw an error.
63
63
 
64
64
  ## Documentation
65
65
 
@@ -28,7 +28,6 @@ IMAGE_TABLE = {
28
28
  'RedHat-7' => 'rhel-7',
29
29
  'RedHat-8' => 'rhel-8',
30
30
  'RedHat-9' => 'rhel-9',
31
- 'RedHat-9-arm' => 'rhel-9-arm64',
32
31
  'SLES-12' => 'sles-12',
33
32
  'SLES-15' => 'sles-15',
34
33
  'Windows-2016' => 'windows-2016',
@@ -36,6 +35,11 @@ IMAGE_TABLE = {
36
35
  'Windows-2022' => 'windows-2022'
37
36
  }.freeze
38
37
 
38
+ ARM_IMAGE_TABLE = {
39
+ 'RedHat-9-arm' => 'rhel-9-arm64',
40
+ 'Ubuntu-22.04-arm' => 'ubuntu-2204-lts-arm64'
41
+ }.freeze
42
+
39
43
  DOCKER_PLATFORMS = {
40
44
  'CentOS-6' => 'litmusimage/centos:6',
41
45
  'CentOS-7' => 'litmusimage/centos:7',
@@ -112,7 +116,6 @@ if ARGV.include?('--provision-service')
112
116
  'Ubuntu-20.04' => 'ubuntu-2004-lts',
113
117
  'Ubuntu-22.04' => 'ubuntu-2204-lts'
114
118
  }
115
-
116
119
  updated_list = IMAGE_TABLE.dup.clone
117
120
  updated_list.merge!(updated_platforms)
118
121
 
@@ -152,7 +155,14 @@ else
152
155
  os = sup['operatingsystem']
153
156
  sup['operatingsystemrelease'].sort_by(&:to_i).each do |ver|
154
157
  image_key = "#{os}-#{ver}"
155
-
158
+ # Add ARM images if they exist and are not excluded
159
+ if ARM_IMAGE_TABLE.key?("#{image_key}-arm") && !exclude_list.include?("#{image_key.downcase}-arm")
160
+ matrix[:platforms] << {
161
+ label: "#{image_key}-arm",
162
+ provider: 'provision_service',
163
+ image: ARM_IMAGE_TABLE["#{image_key}-arm"]
164
+ }
165
+ end
156
166
  if IMAGE_TABLE.key?(image_key) && !exclude_list.include?(image_key.downcase)
157
167
  matrix[:platforms] << {
158
168
  label: image_key,
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION = '1.2.0'
5
+ VERSION = '1.3.0'
6
6
  end
@@ -24,14 +24,15 @@
24
24
  "operatingsystem": "RedHat",
25
25
  "operatingsystemrelease": [
26
26
  "8",
27
- "9-arm"
27
+ "9"
28
28
  ]
29
29
  },
30
30
  {
31
31
  "operatingsystem": "Ubuntu",
32
32
  "operatingsystemrelease": [
33
33
  "14.04",
34
- "18.04"
34
+ "18.04",
35
+ "22.04"
35
36
  ]
36
37
  }
37
38
  ],
@@ -16,7 +16,7 @@ RSpec.describe 'matrix_from_metadata_v2' do
16
16
  expect(result.status_code).to eq 0
17
17
  end
18
18
 
19
- it 'generates the matrix' do
19
+ it 'generates the matrix' do # rubocop:disable RSpec/ExampleLength
20
20
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
21
21
  expect(github_output_content).to include(
22
22
  [
@@ -24,8 +24,11 @@ RSpec.describe 'matrix_from_metadata_v2' do
24
24
  '"platforms":[',
25
25
  '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
26
26
  '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
27
+ '{"label":"RedHat-9","provider":"provision_service","image":"rhel-9"},',
27
28
  '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
28
- '{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"}',
29
+ '{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"},',
30
+ '{"label":"Ubuntu-22.04","provider":"docker","image":"litmusimage/ubuntu:22.04"},',
31
+ '{"label":"Ubuntu-22.04-arm","provider":"provision_service","image":"ubuntu-2204-lts-arm64"}',
29
32
  '],',
30
33
  '"collection":[',
31
34
  '"puppet7-nightly","puppet8-nightly"',
@@ -36,7 +39,7 @@ RSpec.describe 'matrix_from_metadata_v2' do
36
39
  expect(github_output_content).to include(
37
40
  'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
38
41
  )
39
- expect(result.stdout).to include("Created matrix with 10 cells:\n - Acceptance Test Cells: 8\n - Spec Test Cells: 2")
42
+ expect(result.stdout).to include("Created matrix with 16 cells:\n - Acceptance Test Cells: 14\n - Spec Test Cells: 2")
40
43
  end
41
44
  end
42
45
 
@@ -53,7 +56,7 @@ RSpec.describe 'matrix_from_metadata_v2' do
53
56
  expect(result.status_code).to eq 0
54
57
  end
55
58
 
56
- it 'generates the matrix without excluded platforms' do
59
+ it 'generates the matrix without excluded platforms' do # rubocop:disable RSpec/ExampleLength
57
60
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
58
61
  expect(result.stdout).to include('::warning::Ubuntu-18.04 was excluded from testing')
59
62
  expect(github_output_content).to include(
@@ -62,7 +65,10 @@ RSpec.describe 'matrix_from_metadata_v2' do
62
65
  '"platforms":[',
63
66
  '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
64
67
  '{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
65
- '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}',
68
+ '{"label":"RedHat-9","provider":"provision_service","image":"rhel-9"},',
69
+ '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
70
+ '{"label":"Ubuntu-22.04","provider":"docker","image":"litmusimage/ubuntu:22.04"},',
71
+ '{"label":"Ubuntu-22.04-arm","provider":"provision_service","image":"ubuntu-2204-lts-arm64"}',
66
72
  '],',
67
73
  '"collection":[',
68
74
  '"puppet7-nightly","puppet8-nightly"',
@@ -73,14 +79,14 @@ RSpec.describe 'matrix_from_metadata_v2' do
73
79
  expect(github_output_content).to include(
74
80
  'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
75
81
  )
76
- expect(result.stdout).to include("Created matrix with 8 cells:\n - Acceptance Test Cells: 6\n - Spec Test Cells: 2")
82
+ expect(result.stdout).to include("Created matrix with 14 cells:\n - Acceptance Test Cells: 12\n - Spec Test Cells: 2")
77
83
  end
78
84
  end
79
85
 
80
86
  context 'with --exclude-platforms \'["ubuntu-18.04","redhat-8"]\'' do
81
87
  let(:github_output) { Tempfile.new('github_output') }
82
88
  let(:github_output_content) { github_output.read }
83
- let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04', 'redhat-8', 'redhat-9'] }) }
89
+ let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04', 'ubuntu-22.04', 'redhat-8', 'redhat-9'] }) }
84
90
 
85
91
  before do
86
92
  ENV['GITHUB_OUTPUT'] = github_output.path
@@ -93,13 +99,15 @@ RSpec.describe 'matrix_from_metadata_v2' do
93
99
  it 'generates the matrix without excluded platforms' do
94
100
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
95
101
  expect(result.stdout).to include('::warning::Ubuntu-18.04 was excluded from testing')
102
+ expect(result.stdout).to include('::warning::Ubuntu-22.04 was excluded from testing')
96
103
  expect(result.stdout).to include('::warning::RedHat-8 was excluded from testing')
97
104
  expect(github_output_content).to include(
98
105
  [
99
106
  'matrix={',
100
107
  '"platforms":[',
101
108
  '{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
102
- '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}',
109
+ '{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
110
+ '{"label":"Ubuntu-22.04-arm","provider":"provision_service","image":"ubuntu-2204-lts-arm64"}',
103
111
  '],',
104
112
  '"collection":[',
105
113
  '"puppet7-nightly","puppet8-nightly"',
@@ -110,7 +118,7 @@ RSpec.describe 'matrix_from_metadata_v2' do
110
118
  expect(github_output_content).to include(
111
119
  'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
112
120
  )
113
- expect(result.stdout).to include("Created matrix with 6 cells:\n - Acceptance Test Cells: 4\n - Spec Test Cells: 2")
121
+ expect(result.stdout).to include("Created matrix with 8 cells:\n - Acceptance Test Cells: 6\n - Spec Test Cells: 2")
114
122
  end
115
123
  end
116
124
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_litmus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-25 00:00:00.000000000 Z
11
+ date: 2023-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt