Showing with 44 additions and 126 deletions.
  1. +13 −93 .github/workflows/ci.yml
  2. +2 −1 .gitignore
  3. +1 −2 .sync.yml
  4. +12 −0 CHANGELOG.md
  5. +1 −1 CONTRIBUTING.md
  6. +5 −13 Gemfile
  7. +6 −6 metadata.json
  8. +1 −3 spec/acceptance/plugins_spec.rb
  9. +2 −1 spec/support/acceptance/curl_command.rb
  10. +1 −6 spec/support/acceptance/examples.rb
106 changes: 13 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,20 @@
---
name: CI

on:
pull_request:
schedule:
- cron: '4 4 * * *'

jobs:
setup_matrix:
if: github.event_name != 'schedule' || github.repository_owner == 'theforeman'
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
outputs:
beaker_setfiles: ${{ steps.get_outputs.outputs.beaker_setfiles }}
puppet_major_versions: ${{ steps.get_outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get_outputs.outputs.puppet_unit_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_GEM_VERSION: '~> 7.24'
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run rake check
run: bundle exec rake check
- name: Run rake validate
run: bundle exec rake validate
- name: Run rake lint
run: bundle exec rake lint
- name: Setup Test Matrix
id: get_outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.24"
name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: '1'
- name: Run tests
run: bundle exec rake parallel_spec

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
PUPPET_GEM_VERSION: '~> 7.24'
strategy:
fail-fast: false
matrix:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
pulpcore_version:
- '3.28'
- '3.22'
- '3.21'
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - Pulp ${{ matrix.pulpcore_version }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
cache-version: '1'
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
# In Puppet 7 the locale ends up being C.UTF-8 if it isn't passed.
# This locale doesn't exist in EL7 and won't be supported either.
LANG: en_US.UTF-8
BEAKER_FACTER_PULPCORE_VERSION: ${{ matrix.pulpcore_version }}
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true

tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
rubocop: false
cache-version: '1'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ vendor/
.ruby-*

## rspec
spec/fixtures/
spec/fixtures/manifests
spec/fixtures/modules
junit/

## Puppet module
Expand Down
3 changes: 1 addition & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# This file is different in that it also tests multiple pulpcore versions
.github/workflows/ci.yml:
unmanaged: true
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [8.6.0](https://github.com/theforeman/puppet-pulpcore/tree/8.6.0) (2023-11-15)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/8.5.0...8.6.0)

**Implemented enhancements:**

- Mark compatible with puppetlabs/postgresql 10.x [\#316](https://github.com/theforeman/puppet-pulpcore/pull/316) ([ekohl](https://github.com/ekohl))
- Mark compatible with puppet-extlib 7.x [\#314](https://github.com/theforeman/puppet-pulpcore/pull/314) ([ekohl](https://github.com/ekohl))
- Mark compatible with puppet/systemd 6.x [\#313](https://github.com/theforeman/puppet-pulpcore/pull/313) ([ekohl](https://github.com/ekohl))
- Mark compatible with puppetlabs/apache 11.x [\#308](https://github.com/theforeman/puppet-pulpcore/pull/308) ([ekohl](https://github.com/ekohl))
- Add Puppet 8 support [\#297](https://github.com/theforeman/puppet-pulpcore/pull/297) ([bastelfreak](https://github.com/bastelfreak))

## [8.5.0](https://github.com/theforeman/puppet-pulpcore/tree/8.5.0) (2023-09-18)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/8.4.0...8.5.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ More filter info available [here](https://relishapp.com/rspec/rspec-core/v/3-9/d
To run OS specific tests:

```shell
SPEC_FACTS_OS=redhat-7-x86_64 bundle exec rspec spec/classes/foreman_spec.rb
SPEC_FACTS_OS=redhat-8-x86_64 bundle exec rspec spec/classes/foreman_spec.rb
```

If you have more than one version of `redhat` OS specified in metadata.json,
Expand Down
18 changes: 5 additions & 13 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@

source 'https://rubygems.org'

gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
gem 'puppet', ENV.fetch('PUPPET_GEM_VERSION', '>= 7'), groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-empty_string-check', {"groups"=>["test"]}
gem 'puppet-lint-file_ensure-check', {"groups"=>["test"]}
gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 5.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 1.0', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 7.0', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 1.3'
gem 'puppet_metadata', '~> 3.4'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'voxpupuli-acceptance', '~> 2.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}

# Pin rdoc to prevent updating bundled psych (https://github.com/ruby/rdoc/commit/ebe185c8775b2afe844eb3da6fa78adaa79e29a4)
gem 'rdoc', '< 6.4'

# vim:ft=ruby
12 changes: 6 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "8.5.0",
"version": "8.6.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand All @@ -20,19 +20,19 @@
},
{
"name": "puppetlabs/apache",
"version_requirement": ">= 5.4.0 < 11.0.0"
"version_requirement": ">= 5.4.0 < 12.0.0"
},
{
"name": "puppetlabs/postgresql",
"version_requirement": ">= 6.5.0 < 10.0.0"
"version_requirement": ">= 6.5.0 < 11.0.0"
},
{
"name": "puppet/systemd",
"version_requirement": ">= 2.2.0 < 6.0.0"
"version_requirement": ">= 2.2.0 < 7.0.0"
},
{
"name": "puppet/extlib",
"version_requirement": ">= 3.0.0 < 7.0.0"
"version_requirement": ">= 3.0.0 < 8.0.0"
}
],
"operatingsystem_support": [
Expand All @@ -54,7 +54,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 7.0.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 9.0.0"
}
]
}
4 changes: 1 addition & 3 deletions spec/acceptance/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
include pulpcore::plugin::container
include pulpcore::plugin::deb
include pulpcore::plugin::file
if versioncmp(fact('os.release.major'), '8') >= 0 {
include pulpcore::plugin::ostree
}
include pulpcore::plugin::ostree
include pulpcore::plugin::python
include pulpcore::plugin::rpm
PUPPET
Expand Down
3 changes: 2 additions & 1 deletion spec/support/acceptance/curl_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def body_as_json
private

def curl_command
command = "curl --silent --write-out '%{stderr}Response-Code: %{response_code}\\n' '#{@name}'"
# curl on EL8 is too old to support --write-out %stderr
command = "/opt/puppetlabs/puppet/bin/curl --silent --write-out '%{stderr}Response-Code: %{response_code}\\n' '#{@name}'"

@options.each do |option, value|
case option
Expand Down
7 changes: 1 addition & 6 deletions spec/support/acceptance/examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@
end

describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/", cacert: "#{certdir}/ca-cert.pem") do
# Requires authentication: https://github.com/pulp/pulpcore/issues/2340
if(!['3.16', '3.17', '3.18', '3.19'].include?(ENV['BEAKER_FACTER_PULPCORE_VERSION']))
its(:response_code) { is_expected.to eq(200) }
else
its(:response_code) { is_expected.to eq(403) }
end
its(:response_code) { is_expected.to eq(200) }
its(:exit_status) { is_expected.to eq 0 }
end

Expand Down