puppet_litmus 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/exe/matrix_from_metadata_v2 +13 -3
- data/lib/puppet_litmus/version.rb +1 -1
- data/spec/exe/fake_metadata.json +3 -2
- data/spec/exe/matrix_from_metadata_v2_spec.rb +17 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ccf17917e989f2e0396f8b0611dd22cdf714b1e72db8be39e44b796e29e6044
|
4
|
+
data.tar.gz: fffb9cd11af3950794c48b23767e4990a278d4c9f2584497d432157b7c1cc031
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
|
data/exe/matrix_from_metadata_v2
CHANGED
@@ -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,
|
data/spec/exe/fake_metadata.json
CHANGED
@@ -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
|
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
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bolt
|