puppet_litmus 0.25.1 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/matrix_from_metadata_v2 +29 -10
- data/lib/puppet_litmus/puppet_helpers.rb +7 -1
- data/lib/puppet_litmus/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bdab1c08e816eff65e739dedfb40a8d4c28070db7e6e615f9ff522f24b6a936
|
4
|
+
data.tar.gz: 2c24faff1b04809ef56fbce9094967e0de7205940b1bd8c117e597ccce910d9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd688cb89cb681e564d26ce30cb9f829efbd7643e747b6c3ecec2546ffe168f5666de91d8237c393061a357c52f35f9c7240bde66f01420d2400601c645cab9
|
7
|
+
data.tar.gz: a209e6862ceaa6834134420181632e01ff15193220bc3c8618f1196f5523e03d2fad334494583ac9d39fd3e966f1382064b87e216a2773871766e5ae80b4634e
|
data/exe/matrix_from_metadata_v2
CHANGED
@@ -34,16 +34,26 @@ DOCKER_PLATFORMS = {
|
|
34
34
|
|
35
35
|
# This table uses the latest version in each collection for accurate
|
36
36
|
# comparison when evaluating puppet requirements from the metadata
|
37
|
-
COLLECTION_TABLE =
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
COLLECTION_TABLE = [
|
38
|
+
{
|
39
|
+
puppet_maj_version: 6,
|
40
|
+
ruby_version: 2.5,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
puppet_maj_version: 7,
|
44
|
+
ruby_version: 2.7,
|
45
|
+
},
|
46
|
+
].freeze
|
41
47
|
|
42
48
|
matrix = {
|
43
49
|
platforms: [],
|
44
50
|
collection: [],
|
45
51
|
}
|
46
52
|
|
53
|
+
spec_matrix = {
|
54
|
+
include: [],
|
55
|
+
}
|
56
|
+
|
47
57
|
metadata = JSON.parse(File.read('metadata.json'))
|
48
58
|
# Set platforms based on declared operating system support
|
49
59
|
metadata['operatingsystem_support'].sort_by { |a| a['operatingsystem'] }.each do |sup|
|
@@ -83,17 +93,20 @@ if metadata.key?('requirements') && metadata['requirements'].length.positive?
|
|
83
93
|
cmp_one, ver_one, cmp_two, ver_two = match.captures
|
84
94
|
reqs = ["#{cmp_one} #{ver_one}", "#{cmp_two} #{ver_two}"]
|
85
95
|
|
86
|
-
COLLECTION_TABLE.each do |
|
87
|
-
|
88
|
-
|
89
|
-
|
96
|
+
COLLECTION_TABLE.each do |collection|
|
97
|
+
# 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.
|
98
|
+
# 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.
|
99
|
+
next unless Gem::Requirement.create(reqs).satisfied_by?(Gem::Version.new("#{collection[:puppet_maj_version]}.9999"))
|
100
|
+
|
101
|
+
matrix[:collection] << "puppet#{collection[:puppet_maj_version]}-nightly"
|
102
|
+
spec_matrix[:include] << { puppet_version: "~> #{collection[:puppet_maj_version]}.0", ruby_version: collection[:ruby_version] }
|
90
103
|
end
|
91
104
|
end
|
92
105
|
end
|
93
106
|
|
94
107
|
# Set to defaults (all collections) if no matches are found
|
95
108
|
if matrix[:collection].empty?
|
96
|
-
matrix[:collection] = COLLECTION_TABLE.
|
109
|
+
matrix[:collection] = COLLECTION_TABLE.map { |collection| "puppet#{collection[:puppet_maj_version]}-nightly" }
|
97
110
|
end
|
98
111
|
|
99
112
|
# Just to make sure there aren't any duplicates
|
@@ -101,5 +114,11 @@ matrix[:platforms] = matrix[:platforms].uniq.sort { |a, b| a[:label] <=> b[:labe
|
|
101
114
|
matrix[:collection] = matrix[:collection].uniq.sort
|
102
115
|
|
103
116
|
puts "::set-output name=matrix::#{JSON.generate(matrix)}"
|
117
|
+
puts "::set-output name=spec_matrix::#{JSON.generate(spec_matrix)}"
|
118
|
+
|
119
|
+
acceptance_test_cell_count = matrix[:platforms].length * matrix[:collection].length
|
120
|
+
spec_test_cell_count = spec_matrix[:include].length
|
104
121
|
|
105
|
-
puts "Created matrix with #{
|
122
|
+
puts "Created matrix with #{acceptance_test_cell_count + spec_test_cell_count} cells:"
|
123
|
+
puts " - Acceptance Test Cells: #{acceptance_test_cell_count}"
|
124
|
+
puts " - Spec Test Cells: #{spec_test_cell_count}"
|
@@ -75,7 +75,13 @@ module PuppetLitmus::PuppetHelpers
|
|
75
75
|
span.add_field('litmus.node_name', target_node_name)
|
76
76
|
add_platform_field(inventory_hash, target_node_name)
|
77
77
|
|
78
|
-
|
78
|
+
# Forcibly set the locale of the command
|
79
|
+
locale = if os[:family] != 'windows'
|
80
|
+
'LC_ALL=en_US.UTF-8 '
|
81
|
+
else
|
82
|
+
''
|
83
|
+
end
|
84
|
+
command_to_run = "#{locale}#{opts[:prefix_command]} puppet apply #{manifest_file_location}"
|
79
85
|
command_to_run += ' --trace' if !opts[:trace].nil? && (opts[:trace] == true)
|
80
86
|
command_to_run += " --modulepath #{Dir.pwd}/spec/fixtures/modules" if target_node_name == 'litmus_localhost'
|
81
87
|
command_to_run += " --hiera_config='#{opts[:hiera_config]}'" unless opts[:hiera_config].nil?
|
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.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bolt
|
@@ -196,7 +196,7 @@ homepage: https://github.com/puppetlabs/puppet_litmus
|
|
196
196
|
licenses:
|
197
197
|
- Apache-2.0
|
198
198
|
metadata: {}
|
199
|
-
post_install_message:
|
199
|
+
post_install_message:
|
200
200
|
rdoc_options: []
|
201
201
|
require_paths:
|
202
202
|
- lib
|
@@ -211,8 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
|
-
rubygems_version: 3.0.
|
215
|
-
signing_key:
|
214
|
+
rubygems_version: 3.0.3
|
215
|
+
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: Providing a simple command line tool for puppet content creators, to enable
|
218
218
|
simple and complex test deployments.
|