Skip to content

Commit

Permalink
Merge pull request #496 from puppetlabs/MAINT-force_newer_puppet7_gem
Browse files Browse the repository at this point in the history
(MAINT) Force newer Puppet 7 Gem
  • Loading branch information
chelnak committed Apr 25, 2023
2 parents 5314169 + 70f2fc0 commit e3d3c42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions exe/matrix_from_metadata_v2
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ if metadata.key?('requirements') && metadata['requirements'].length.positive?
next unless Gem::Requirement.create(reqs).satisfied_by?(Gem::Version.new("#{collection[:puppet_maj_version]}.9999"))

matrix[:collection] << "puppet#{collection[:puppet_maj_version]}-nightly"
spec_matrix[:include] << if collection[:puppet_maj_version] == 8
{ puppet_version: 'https://github.com/puppetlabs/puppet', ruby_version: collection[:ruby_version] }
else
{ puppet_version: "~> #{collection[:puppet_maj_version]}.0", ruby_version: collection[:ruby_version] }
end

include_version = {
8 => "~> #{collection[:puppet_maj_version]}.0",
7 => "~> #{collection[:puppet_maj_version]}.24",
6 => "~> #{collection[:puppet_maj_version]}.0"
}
spec_matrix[:include] << { puppet_version: include_version[collection[:puppet_maj_version]], ruby_version: collection[:ruby_version] }
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/exe/matrix_from_metadata_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
].join
)
expect(github_output_content).to include(
'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}'
'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
)
expect(result.stdout).to include("Created matrix with 8 cells:\n - Acceptance Test Cells: 6\n - Spec Test Cells: 2")
end
Expand Down Expand Up @@ -69,7 +69,7 @@
].join
)
expect(github_output_content).to include(
'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}'
'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
)
expect(result.stdout).to include("Created matrix with 6 cells:\n - Acceptance Test Cells: 4\n - Spec Test Cells: 2")
end
Expand Down Expand Up @@ -105,7 +105,7 @@
].join
)
expect(github_output_content).to include(
'spec_matrix={"include":[{"puppet_version":"~> 7.0","ruby_version":2.7},{"puppet_version":"https://github.com/puppetlabs/puppet","ruby_version":3.2}]}'
'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}'
)
expect(result.stdout).to include("Created matrix with 4 cells:\n - Acceptance Test Cells: 2\n - Spec Test Cells: 2")
end
Expand Down

0 comments on commit e3d3c42

Please sign in to comment.