puppet_litmus 1.5.1 → 1.6.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: 0b3d7f9bedf579302119d547c1adbad6e66abaec557d06212b2a7f1e57f0e974
4
- data.tar.gz: '08aad526e8ddee41f5ee9f53bd22041dd41776848fe8913e9379b1c6a7802320'
3
+ metadata.gz: 53b43f12e2dd8f46fc1f041080b9bde92d16bb310995321017600683d0c870bf
4
+ data.tar.gz: dbc6ca5c092d8cfca91784cbd67561ce10d588eeb83633862ce8f26b763c082f
5
5
  SHA512:
6
- metadata.gz: a5ce63248658dccec7e682275b59dea4a465e2c57f881fffdba817f06d8e8420d34d3547963d1baf7c0d0ef8218ca652be0bb9720cd10de8f33a23bff40aa868
7
- data.tar.gz: 8193b813317da8222f25c97cb7973db11de33f8ed36ece22f38628f4971ee6d9d9a63d438b43ec518a20875c745c3958e69498adee52af5d3e9256e743ce5827
6
+ metadata.gz: fca2f16bbde0eb8893e216c3aa4de040a4f2aa014175531d6c9b74c71f33bab8c4d9d16f49556a7e09c42e45ced0c5dfecf0169def6df243b47826feaafd1d48
7
+ data.tar.gz: 33bd34e230c46e92612a91f075088969c2eab1bd65c0c36a345222c9c44f838e240959030ed1c2c0cc05da3251aa024904a54da2fb4f8ce33865494ec5c18e6a
data/exe/matrix.json CHANGED
@@ -40,7 +40,8 @@
40
40
  },
41
41
  "Ubuntu": {
42
42
  "20.04": { "x86_64": "ubuntu-2004-lts" },
43
- "22.04": { "x86_64": "ubuntu-2204-lts", "arm": "ubuntu-2204-lts-arm64" }
43
+ "22.04": { "x86_64": "ubuntu-2204-lts", "arm": "ubuntu-2204-lts-arm64" },
44
+ "24.04": { "x86_64": "ubuntu-2404-lts", "arm": "ubuntu-2404-lts-arm64" }
44
45
  },
45
46
  "Windows": {
46
47
  "2016": { "x86_64": "windows-2016" },
@@ -82,7 +83,8 @@
82
83
  "Ubuntu": {
83
84
  "18.04": { "x86_64": "litmusimage/ubuntu:18.04" },
84
85
  "20.04": { "x86_64": "litmusimage/ubuntu:20.04" },
85
- "22.04": { "x86_64": "litmusimage/ubuntu:22.04" }
86
+ "22.04": { "x86_64": "litmusimage/ubuntu:22.04" },
87
+ "24.04": { "x86_64": "litmusimage/ubuntu:24.04" }
86
88
  }
87
89
  }
88
90
  },
@@ -38,7 +38,8 @@ IMAGE_TABLE = {
38
38
  ARM_IMAGE_TABLE = {
39
39
  'Debian-12-arm' => 'debian-12-arm64',
40
40
  'RedHat-9-arm' => 'rhel-9-arm64',
41
- 'Ubuntu-22.04-arm' => 'ubuntu-2204-lts-arm64'
41
+ 'Ubuntu-22.04-arm' => 'ubuntu-2204-lts-arm64',
42
+ 'Ubuntu-24.04-arm' => 'ubuntu-2404-lts-arm64'
42
43
  }.freeze
43
44
 
44
45
  DOCKER_PLATFORMS = {
@@ -60,7 +61,8 @@ DOCKER_PLATFORMS = {
60
61
  'Scientific-7' => 'litmusimage/scientificlinux:7',
61
62
  'Ubuntu-18.04' => 'litmusimage/ubuntu:18.04',
62
63
  'Ubuntu-20.04' => 'litmusimage/ubuntu:20.04',
63
- 'Ubuntu-22.04' => 'litmusimage/ubuntu:22.04'
64
+ 'Ubuntu-22.04' => 'litmusimage/ubuntu:22.04',
65
+ 'Ubuntu-24.04' => 'litmusimage/ubuntu:24.04'
64
66
  }.freeze
65
67
 
66
68
  # This table uses the latest version in each collection for accurate
@@ -119,7 +121,8 @@ if ARGV.include?('--provision-service')
119
121
  'Debian-11' => 'debian-11',
120
122
  'Debian-12' => 'debian-12',
121
123
  'Ubuntu-20.04' => 'ubuntu-2004-lts',
122
- 'Ubuntu-22.04' => 'ubuntu-2204-lts'
124
+ 'Ubuntu-22.04' => 'ubuntu-2204-lts',
125
+ 'Ubuntu-24.04' => 'ubuntu-2404-lts'
123
126
  }
124
127
  updated_list = IMAGE_TABLE.dup.clone
125
128
  updated_list.merge!(updated_platforms)
@@ -147,6 +147,8 @@ begin
147
147
 
148
148
  opt.on('--runner NAME', String, "Default Github action runner (default: #{default_options[:runner]})") { |o| options.runner = o }
149
149
 
150
+ opt.on('--pe-include', TrueClass, 'Include Puppet Enterprise LTS') { |o| options.pe_include = o }
151
+
150
152
  opt.on('--puppet-include MAJOR', Integer, 'Select puppet major version') { |o| options.puppet_include << o }
151
153
  opt.on('--puppet-exclude MAJOR', Integer, 'Filter puppet major version') { |o| options.puppet_exclude << o }
152
154
 
@@ -219,6 +221,27 @@ options[:metadata]['requirements']&.each do |req|
219
221
  break
220
222
  end
221
223
 
224
+ gem_req = Gem::Requirement.create(puppet_version_reqs)
225
+
226
+ # Add PE LTS to the collection matrix
227
+ if options[:pe_include]
228
+ require 'puppet_forge'
229
+
230
+ PuppetForge.user_agent = 'Puppet/Litmus'
231
+
232
+ forge_conn = PuppetForge::Connection.make_connection('https://forge.puppet.com')
233
+ pe_tracks = forge_conn.get('/private/versions/pe')
234
+ lts_tracklist = pe_tracks.body.select { |ver| ver[:lts] == true }
235
+
236
+ lts_tracklist.each do |track|
237
+ if gem_req.satisfied_by?(Gem::Version.new(track[:versions][0][:puppet].to_s))
238
+ matrix[:collection] << "#{track[:latest]}-puppet_enterprise"
239
+ else
240
+ Action.debug("PE #{track[:latest]} (puppet v#{track[:versions][0][:puppet]}) outside requirements #{puppet_version_reqs}")
241
+ end
242
+ end
243
+ end
244
+
222
245
  options[:matrix]['collections'].each do |collection|
223
246
  next unless options[:puppet_include].each do |major|
224
247
  break if major != collection['puppet'].to_i
@@ -235,7 +258,6 @@ options[:metadata]['requirements']&.each do |req|
235
258
 
236
259
  # Test against the "largest" puppet version in a collection, e.g. `7.9999` to allow puppet requirements with a non-zero lower bound on minor/patch versions.
237
260
  # This assumes that such a boundary will always allow the latest actually existing puppet version of a release stream, trading off simplicity vs accuracy here.
238
- gem_req = Gem::Requirement.create(puppet_version_reqs)
239
261
  next unless gem_req.satisfied_by?(Gem::Version.new("#{collection['puppet'].to_i}.9999"))
240
262
 
241
263
  matrix[:collection] << "puppet#{collection['puppet'].to_i}-nightly"
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION = '1.5.1'
5
+ VERSION = '1.6.0'
6
6
  end
@@ -202,4 +202,42 @@ RSpec.describe 'matrix_from_metadata_v3' do
202
202
  )
203
203
  end
204
204
  end
205
+
206
+ context 'with --pe-include' do
207
+ let(:result) { run_matrix_from_metadata_v3(['--puppetlabs', '--pe-include']) }
208
+ let(:matrix) do
209
+ [
210
+ 'matrix={',
211
+ '"platforms":[',
212
+ '{"label":"AmazonLinux-2","provider":"docker","arch":"x86_64","image":"litmusimage/amazonlinux:2","runner":"ubuntu-20.04"},',
213
+ '{"label":"AmazonLinux-2023","provider":"docker","arch":"x86_64","image":"litmusimage/amazonlinux:2023","runner":"ubuntu-20.04"},',
214
+ '{"label":"Ubuntu-18.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:18.04","runner":"ubuntu-20.04"},',
215
+ '{"label":"Ubuntu-22.04","provider":"docker","arch":"x86_64","image":"litmusimage/ubuntu:22.04","runner":"ubuntu-latest"}',
216
+ '],',
217
+ '"collection":[',
218
+ '"puppet7-nightly","puppet8-nightly"',
219
+ ']',
220
+ '}'
221
+ ].join
222
+ end
223
+
224
+ it 'run successfully' do
225
+ expect(result.status_code).to eq 0
226
+ end
227
+
228
+ it 'generates the matrix with PE LTS versions' do
229
+ expect(result.stdout).to include(
230
+ '::warning::CentOS-6 no provisioner found',
231
+ '::warning::Ubuntu-14.04 no provisioner found',
232
+ '::group::matrix',
233
+ '::group::spec_matrix'
234
+ )
235
+ expect(github_output_content).to include(
236
+ '"collection":["2023.8.0-puppet_enterprise","2021.7.9-puppet_enterprise","puppet7-nightly","puppet8-nightly"'
237
+ )
238
+ expect(github_output_content).to include(
239
+ 'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
240
+ )
241
+ end
242
+ end
205
243
  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.5.1
4
+ version: 1.6.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: 2024-10-03 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt