puppet_litmus 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb5f589532820aa9325ab3653f0f02868f0127feb8d18c7b129c64c4358ce2c3
4
- data.tar.gz: 66246c52058e285899fd523803dd32a0e097c7eef34c15e5f7a3b7525f1b2775
3
+ metadata.gz: 53b43f12e2dd8f46fc1f041080b9bde92d16bb310995321017600683d0c870bf
4
+ data.tar.gz: dbc6ca5c092d8cfca91784cbd67561ce10d588eeb83633862ce8f26b763c082f
5
5
  SHA512:
6
- metadata.gz: 545df42c21e51cba530a74efd86d7275399190a1d3ebb5be20017eae10ac9d90ba71c92eb7c5a290dd5eed6221c955e83bcc539611d8bdcedda16d06ea61118c
7
- data.tar.gz: fd36021b42b2d7ad2502c85394f767317f05561d37ab2bde05d38adf45d667cb045ea9c736b41518bd6dc5e54f48287069802a1e0253adebb6c4a0dbb77e36bc
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"
@@ -128,6 +128,7 @@ namespace :litmus do
128
128
  Rake::Task['spec_prep'].invoke
129
129
 
130
130
  results = install_agent(args[:collection], targets, inventory_hash)
131
+ target_index = 0
131
132
  results.each do |result|
132
133
  command_to_run = "bolt task run puppet_agent::install --targets #{result['target']} --inventoryfile spec/fixtures/litmus_inventory.yaml --modulepath #{DEFAULT_CONFIG_DATA['modulepath']}"
133
134
  raise "Failed on #{result['target']}\n#{result}\ntry running '#{command_to_run}'" if result['status'] != 'success'
@@ -157,7 +158,8 @@ namespace :litmus do
157
158
  end
158
159
 
159
160
  # add puppet-agent feature to successful nodes
160
- inventory_hash = add_feature_to_node(inventory_hash, 'puppet-agent', result['target'])
161
+ inventory_hash = add_feature_to_node(inventory_hash, 'puppet-agent', targets[target_index])
162
+ target_index += 1
161
163
  end
162
164
 
163
165
  # update the inventory with the puppet-agent feature set per node
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION = '1.5.0'
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.0
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-08-05 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