puppet_litmus 1.5.1 → 1.6.1
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 +4 -4
- data/exe/matrix.json +4 -2
- data/exe/matrix_from_metadata_v2 +6 -3
- data/exe/matrix_from_metadata_v3 +23 -1
- data/lib/puppet_litmus/version.rb +1 -1
- data/spec/exe/matrix_from_metadata_v3_spec.rb +38 -0
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 972d1bfa360c9c0312d67dbeee0cc61fb6024b74a6464e1ce538033d9e8bd4e1
         | 
| 4 | 
            +
              data.tar.gz: 54aaa27bf44f594ec09ba46e9067223d4b467d9a1723393c64c026d8cb6b7480
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9bfb060fd3c53b16167df18162c1a9a0a02a9cb0185161b321cf7ac349fe8fc6f425e9f458a56d29da6907dbcd80afa102689c1c00e7a32fe74107d48f14e82e
         | 
| 7 | 
            +
              data.tar.gz: 212218938af470ff6bb2422801f9a6b8d6050acdd2d3bee4cd4c2c2a2837dea8b4334dfc58163734809821a4f24681fa70f63f2ee07dff4701045e92dbf3eb5a
         | 
    
        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 | 
             
                },
         | 
    
        data/exe/matrix_from_metadata_v2
    CHANGED
    
    | @@ -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)
         | 
    
        data/exe/matrix_from_metadata_v3
    CHANGED
    
    | @@ -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"
         | 
| @@ -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. | 
| 4 | 
            +
              version: 1.6.1
         | 
| 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- | 
| 11 | 
            +
            date: 2024-12-11 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bolt
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: ' | 
| 19 | 
            +
                    version: '4.0'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: ' | 
| 26 | 
            +
                    version: '4.0'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: docker-api
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         |