puppet_litmus 0.25.1 → 0.26.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: 228833b61d086ab7b01341ce03eb1169c309855209ca8a1345d55525fbe6403b
4
- data.tar.gz: 9e1f9a8f180f047bf49ac493b00871294bf22adccc134fbea6aa7c46fa8b6769
3
+ metadata.gz: 3bdab1c08e816eff65e739dedfb40a8d4c28070db7e6e615f9ff522f24b6a936
4
+ data.tar.gz: 2c24faff1b04809ef56fbce9094967e0de7205940b1bd8c117e597ccce910d9e
5
5
  SHA512:
6
- metadata.gz: efc5c864bf1781678e2cfd729bbbe2e5bdbe1f0eb03b244f135d892629c6e404aa01c1290fb001bb5616f8149800ff05e55fb57abb78b4f2041d1539ab18864d
7
- data.tar.gz: 1b12e3fcd6b1d9def5040c720a543a44df317538dcfe9058930a205412c709ff6160215edacaa4f6c22e6c2223b543d9f6d7ccc884b059ce849c5c83ce3079e1
6
+ metadata.gz: 4bd688cb89cb681e564d26ce30cb9f829efbd7643e747b6c3ecec2546ffe168f5666de91d8237c393061a357c52f35f9c7240bde66f01420d2400601c645cab9
7
+ data.tar.gz: a209e6862ceaa6834134420181632e01ff15193220bc3c8618f1196f5523e03d2fad334494583ac9d39fd3e966f1382064b87e216a2773871766e5ae80b4634e
@@ -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
- '6.24.0' => 'puppet6-nightly',
39
- '7.4.0' => 'puppet7-nightly',
40
- }.freeze
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 |key, val|
87
- if Gem::Requirement.create(reqs).satisfied_by?(Gem::Version.new(key))
88
- matrix[:collection] << val
89
- end
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.values
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 #{matrix[:platforms].length * matrix[:collection].length} cells."
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
- command_to_run = "#{opts[:prefix_command]} puppet apply #{manifest_file_location}"
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?
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version of this gem
4
4
  module PuppetLitmus
5
- VERSION ||= '0.25.1'
5
+ VERSION ||= '0.26.0'
6
6
  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.25.1
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-02-26 00:00:00.000000000 Z
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.6
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.