puppet_litmus 0.34.5 → 0.36.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: ff985b189104c3cbf55d310c602ea525c4ea40a7ad066ed2b0fe078488012416
4
- data.tar.gz: 1bbb7872b1850112936d8222bdeaa71f966da7fa29865950b7a334231e49285b
3
+ metadata.gz: 77aab5b54a57e7de60b83fe6d1ebc2acf6a06f3cf6394106615af2ee5f25dcad
4
+ data.tar.gz: c0da65f29660db619f5d106be38f59c664212254d74e2f10f95623f08627eba7
5
5
  SHA512:
6
- metadata.gz: 984af2490dbd1e17592b2856bd530ddb68e4ee133653157646d110161f4400963d8bb12da097f597981ee191834416544a6b27d5b4bff6586264b31d9b4a6326
7
- data.tar.gz: a7d440fd1b7678efecaec60147fa1672850c93d376fc808f7a25ca58a1f074c3106433acaa68a2015af201beee81f860b3e7dc96c7d02f50119f51f81cb0c9e6
6
+ metadata.gz: 98d8fc0cdbf4d71fadce7c349c8416d39066bab1c7f499f1d68bf771d2af7537b2a0bcdcc1af2c286d09d4d18f424ae34bd05efd0a9fbee8bd2443da48fe8da4
7
+ data.tar.gz: f0d1b6a4c78b8c41b2480996e7ea7a33f7da266054dc08d3aa74b1f906484031999c4d6d4ca7ff5830af8909498ddca5d360e3891783a4afff9eed0ccb7598f9
@@ -5,6 +5,25 @@
5
5
 
6
6
  require 'json'
7
7
 
8
+ # Sets an output variable in GitHub Actions. If the GITHUB_OUTPUT environment
9
+ # variable is not set, this will fail with an exit code of 1 and
10
+ # send an ::error:: message to the GitHub Actions log.
11
+ # @param name [String] The name of the output variable
12
+ # @param value [String] The value of the output variable
13
+
14
+ def set_output(name, value)
15
+ # Get the output path
16
+ output = ENV.fetch('GITHUB_OUTPUT')
17
+
18
+ # Write the output variable to GITHUB_OUTPUT
19
+ File.open(output, 'a') do |f|
20
+ f.puts "#{name}=#{value}"
21
+ end
22
+ rescue KeyError
23
+ puts '::error::GITHUB_OUTPUT environment variable not set.'
24
+ exit 1
25
+ end
26
+
8
27
  IMAGE_TABLE = {
9
28
  'RedHat-7' => 'rhel-7',
10
29
  'RedHat-8' => 'rhel-8',
@@ -92,6 +111,5 @@ end
92
111
  matrix[:platform] = matrix[:platform].uniq.sort
93
112
  matrix[:collection] = matrix[:collection].uniq.sort
94
113
 
95
- puts "::set-output name=matrix::#{JSON.generate(matrix)}"
96
-
114
+ set_output('matrix', JSON.generate(matrix))
97
115
  puts "Created matrix with #{matrix[:platform].length * matrix[:collection].length} cells."
@@ -5,6 +5,25 @@
5
5
 
6
6
  require 'json'
7
7
 
8
+ # Sets an output variable in GitHub Actions. If the GITHUB_OUTPUT environment
9
+ # variable is not set, this will fail with an exit code of 1 and
10
+ # send an ::error:: message to the GitHub Actions log.
11
+ # @param name [String] The name of the output variable
12
+ # @param value [String] The value of the output variable
13
+
14
+ def set_output(name, value)
15
+ # Get the output path
16
+ output = ENV.fetch('GITHUB_OUTPUT')
17
+
18
+ # Write the output variable to GITHUB_OUTPUT
19
+ File.open(output, 'a') do |f|
20
+ f.puts "#{name}=#{value}"
21
+ end
22
+ rescue KeyError
23
+ puts '::error::GITHUB_OUTPUT environment variable not set.'
24
+ exit 1
25
+ end
26
+
8
27
  IMAGE_TABLE = {
9
28
  'RedHat-7' => 'rhel-7',
10
29
  'RedHat-8' => 'rhel-8',
@@ -48,6 +67,10 @@ COLLECTION_TABLE = [
48
67
  puppet_maj_version: 7,
49
68
  ruby_version: 2.7,
50
69
  },
70
+ {
71
+ puppet_maj_version: 8,
72
+ ruby_version: 3.2,
73
+ },
51
74
  ].freeze
52
75
 
53
76
  matrix = {
@@ -137,8 +160,8 @@ end
137
160
  matrix[:platforms] = matrix[:platforms].uniq.sort { |a, b| a[:label] <=> b[:label] }
138
161
  matrix[:collection] = matrix[:collection].uniq.sort
139
162
 
140
- puts "::set-output name=matrix::#{JSON.generate(matrix)}"
141
- puts "::set-output name=spec_matrix::#{JSON.generate(spec_matrix)}"
163
+ set_output('matrix', JSON.generate(matrix))
164
+ set_output('spec_matrix', JSON.generate(spec_matrix))
142
165
 
143
166
  acceptance_test_cell_count = matrix[:platforms].length * matrix[:collection].length
144
167
  spec_test_cell_count = spec_matrix[:include].length
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.34.5'
5
+ VERSION ||= '0.36.0'
6
6
  end
@@ -37,10 +37,10 @@
37
37
  "requirements": [
38
38
  {
39
39
  "name": "puppet",
40
- "version_requirement": ">= 6.0.0 < 8.0.0"
40
+ "version_requirement": ">= 7.0.0 < 9.0.0"
41
41
  }
42
42
  ],
43
43
  "template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
44
- "template-ref": "heads/main-0-g2381db6",
45
- "pdk-version": "2.1.1"
44
+ "template-ref": "tags/2.7.4",
45
+ "pdk-version": "2.7.4"
46
46
  }
@@ -4,38 +4,50 @@ require 'spec_helper'
4
4
 
5
5
  RSpec.describe 'matrix_from_metadata_v2' do
6
6
  context 'without arguments' do
7
+ let(:github_output) { Tempfile.new('github_output') }
8
+ let(:github_output_content) { github_output.read }
7
9
  let(:result) { run_matrix_from_metadata_v2 }
8
10
 
11
+ before(:each) do
12
+ ENV['GITHUB_OUTPUT'] = github_output.path
13
+ end
14
+
9
15
  it 'run successfully' do
10
16
  expect(result.status_code).to eq 0
11
17
  end
12
18
 
13
19
  it 'generates the matrix' do
14
20
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
15
- expect(result.stdout).to include(
21
+ expect(github_output_content).to include(
16
22
  [
17
- '::set-output name=matrix::{',
23
+ 'matrix={',
18
24
  '"platforms":[',
19
25
  '{"label":"CentOS-6","provider":"provision::docker","image":"litmusimage/centos:6"},',
20
26
  '{"label":"RedHat-8","provider":"provision::provision_service","image":"rhel-8"},',
21
27
  '{"label":"Ubuntu-18.04","provider":"provision::docker","image":"litmusimage/ubuntu:18.04"}',
22
28
  '],',
23
29
  '"collection":[',
24
- '"puppet6-nightly","puppet7-nightly"',
30
+ '"puppet7-nightly","puppet8-nightly"',
25
31
  ']',
26
32
  '}',
27
33
  ].join,
28
34
  )
29
- expect(result.stdout).to include(
30
- '::set-output name=spec_matrix::{"include":[{"puppet_version":"~> 6.0","ruby_version":2.5},{"puppet_version":"~> 7.0","ruby_version":2.7}]}',
35
+ expect(github_output_content).to include(
36
+ 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}',
31
37
  )
32
38
  expect(result.stdout).to include("Created matrix with 8 cells:\n - Acceptance Test Cells: 6\n - Spec Test Cells: 2")
33
39
  end
34
40
  end
35
41
 
36
42
  context 'with --exclude-platforms ["ubuntu-18.04"]' do
43
+ let(:github_output) { Tempfile.new('github_output') }
44
+ let(:github_output_content) { github_output.read }
37
45
  let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04'] }) }
38
46
 
47
+ before(:each) do
48
+ ENV['GITHUB_OUTPUT'] = github_output.path
49
+ end
50
+
39
51
  it 'run successfully' do
40
52
  expect(result.status_code).to eq 0
41
53
  end
@@ -43,29 +55,35 @@ RSpec.describe 'matrix_from_metadata_v2' do
43
55
  it 'generates the matrix without excluded platforms' do
44
56
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
45
57
  expect(result.stdout).to include('::warning::Ubuntu-18.04 was excluded from testing')
46
- expect(result.stdout).to include(
58
+ expect(github_output_content).to include(
47
59
  [
48
- '::set-output name=matrix::{',
60
+ 'matrix={',
49
61
  '"platforms":[',
50
62
  '{"label":"CentOS-6","provider":"provision::docker","image":"litmusimage/centos:6"},',
51
63
  '{"label":"RedHat-8","provider":"provision::provision_service","image":"rhel-8"}',
52
64
  '],',
53
65
  '"collection":[',
54
- '"puppet6-nightly","puppet7-nightly"',
66
+ '"puppet7-nightly","puppet8-nightly"',
55
67
  ']',
56
68
  '}',
57
69
  ].join,
58
70
  )
59
- expect(result.stdout).to include(
60
- '::set-output name=spec_matrix::{"include":[{"puppet_version":"~> 6.0","ruby_version":2.5},{"puppet_version":"~> 7.0","ruby_version":2.7}]}',
71
+ expect(github_output_content).to include(
72
+ 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}',
61
73
  )
62
74
  expect(result.stdout).to include("Created matrix with 6 cells:\n - Acceptance Test Cells: 4\n - Spec Test Cells: 2")
63
75
  end
64
76
  end
65
77
 
66
78
  context 'with --exclude-platforms \'["ubuntu-18.04","redhat-8"]\'' do
79
+ let(:github_output) { Tempfile.new('github_output') }
80
+ let(:github_output_content) { github_output.read }
67
81
  let(:result) { run_matrix_from_metadata_v2({ '--exclude-platforms' => ['ubuntu-18.04', 'redhat-8'] }) }
68
82
 
83
+ before(:each) do
84
+ ENV['GITHUB_OUTPUT'] = github_output.path
85
+ end
86
+
69
87
  it 'run successfully' do
70
88
  expect(result.status_code).to eq 0
71
89
  end
@@ -74,20 +92,20 @@ RSpec.describe 'matrix_from_metadata_v2' do
74
92
  expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04')
75
93
  expect(result.stdout).to include('::warning::Ubuntu-18.04 was excluded from testing')
76
94
  expect(result.stdout).to include('::warning::RedHat-8 was excluded from testing')
77
- expect(result.stdout).to include(
95
+ expect(github_output_content).to include(
78
96
  [
79
- '::set-output name=matrix::{',
97
+ 'matrix={',
80
98
  '"platforms":[',
81
99
  '{"label":"CentOS-6","provider":"provision::docker","image":"litmusimage/centos:6"}',
82
100
  '],',
83
101
  '"collection":[',
84
- '"puppet6-nightly","puppet7-nightly"',
102
+ '"puppet7-nightly","puppet8-nightly"',
85
103
  ']',
86
104
  '}',
87
105
  ].join,
88
106
  )
89
- expect(result.stdout).to include(
90
- '::set-output name=spec_matrix::{"include":[{"puppet_version":"~> 6.0","ruby_version":2.5},{"puppet_version":"~> 7.0","ruby_version":2.7}]}',
107
+ expect(github_output_content).to include(
108
+ 'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}',
91
109
  )
92
110
  expect(result.stdout).to include("Created matrix with 4 cells:\n - Acceptance Test Cells: 2\n - Spec Test Cells: 2")
93
111
  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: 0.34.5
4
+ version: 0.36.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-02-27 00:00:00.000000000 Z
11
+ date: 2023-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bolt
@@ -154,6 +154,20 @@ dependencies:
154
154
  - - ">="
155
155
  - !ruby/object:Gem::Version
156
156
  version: '0'
157
+ - !ruby/object:Gem::Dependency
158
+ name: r10k
159
+ requirement: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - '='
162
+ - !ruby/object:Gem::Version
163
+ version: 3.15.1
164
+ type: :runtime
165
+ prerelease: false
166
+ version_requirements: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - '='
169
+ - !ruby/object:Gem::Version
170
+ version: 3.15.1
157
171
  description: " Providing a simple command line tool for puppet content creators,
158
172
  to enable simple and complex test deployments.\n"
159
173
  email:
@@ -215,17 +229,17 @@ specification_version: 4
215
229
  summary: Providing a simple command line tool for puppet content creators, to enable
216
230
  simple and complex test deployments.
217
231
  test_files:
218
- - spec/exe/fake_metadata.json
219
232
  - spec/exe/matrix_from_metadata_v2_spec.rb
220
- - spec/data/doot.tar.gz
221
- - spec/data/jim.yaml
222
- - spec/data/inventory.yaml
223
- - spec/lib/puppet_litmus/puppet_litmus_version_spec.rb
224
- - spec/lib/puppet_litmus/rake_helper_spec.rb
225
- - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
233
+ - spec/exe/fake_metadata.json
226
234
  - spec/lib/puppet_litmus/util_spec.rb
227
- - spec/lib/puppet_litmus/puppet_helpers_spec.rb
235
+ - spec/lib/puppet_litmus/inventory_manipulation_spec.rb
228
236
  - spec/lib/puppet_litmus/rake_tasks_spec.rb
237
+ - spec/lib/puppet_litmus/puppet_helpers_spec.rb
238
+ - spec/lib/puppet_litmus/rake_helper_spec.rb
239
+ - spec/lib/puppet_litmus/puppet_litmus_version_spec.rb
229
240
  - spec/spec_helper.rb
230
- - spec/support/inventory.rb
231
241
  - spec/support/inventorytesting.yaml
242
+ - spec/support/inventory.rb
243
+ - spec/data/doot.tar.gz
244
+ - spec/data/inventory.yaml
245
+ - spec/data/jim.yaml