Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/pr_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ jobs:
strategy:
matrix:
puppet:
- label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
puppet_version: '~> 7.0'
ruby_version: '2.7'
experimental: false
- label: 'Puppet 8.x'
puppet_version: '~> 8.0'
ruby_version: '3.2'
experimental: false
- label: 'OpenVox 8.x'
puppet_version: '~> 8.0'
ruby_version: '3.2'
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ jobs:
strategy:
matrix:
puppet:
- label: 'Puppet 7.x [SIMP 6.6/PE 2021.7]'
puppet_version: '~> 7.0'
ruby_version: '2.7'
experimental: false
- label: 'Puppet 8.x'
- label: 'OpenVox 8.x'
puppet_version: '~> 8.0'
ruby_version: '3.2'
experimental: false
# OpenVox 9 is unreleased; preview the future Ruby 4.0 / OpenVox 9
# combo by running the OpenVox 8 gem on Ruby 4.0.
- label: 'OpenVox 9.x preview (Ruby 4.0, OpenVox 8 gem)'
puppet_version: '~> 8.0'
ruby_version: '4.0'
experimental: false
env:
PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag_deploy_rubygem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ on:
- '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'

env:
PUPPET_VERSION: '~> 7'
PUPPET_VERSION: '~> 8'
LOCAL_WORKFLOW_CONFIG_FILE: .github/workflows.local.json

jobs:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
### 3.0.0 / 2026-06-24
* Changed (**Breaking**):
* Dropped support for Puppet 7 / Ruby 2.7. CI now tests Puppet/OpenVox 8 only,
and the default OpenVox gem floor is raised to `>= 8.0.0`.
* Replaced the `puppetlabs_spec_helper/tasks/fixtures` dependency with
`puppet_fixtures`, enabling Ruby 4.0 support. `puppetlabs_spec_helper` pulls
in `puppet-syntax` < 5, which depends on the `puppet` gem and its `facter`
dependency that does not support Ruby >= 4.0; `puppet_fixtures` is the
OpenVox-ecosystem replacement and supports Ruby 4.0.
* The `beaker:suites` task now depends on `fixtures:prep` (from
`puppet_fixtures`) instead of `spec_prep`, and `ensure_fixture_modules` now
runs `rake fixtures:prep`.
* Added:
* `puppet_fixtures` runtime dependency
* OpenVox-named environment variables for `get_puppet_install_info`, taking
precedence over the Puppet-named equivalents (which remain as fallbacks):
`OPENVOX_VERSION`, `OPENVOX_INSTALL_VERSION`, `OPENVOX_INSTALL_TYPE`,
`BEAKER_OPENVOX_AGENT_VERSION`, `BEAKER_OPENVOX_COLLECTION`,
`BEAKER_OPENVOX_PACKAGE_NAME`

### 2.0.5 / 2026-06-06
* Fixed:
* Additional cleanup for rubocop
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ group :system_tests do
gem 'ed25519'
gem 'net-ssh'
# renovate: datasource=rubygems versioning=ruby
gem 'openvox', ENV.fetch('OPENVOX_VERSION', ENV.fetch('PUPPET_VERSION', ['>= 7.0.0', '< 9.0.0']))
gem 'openvox', ENV.fetch('OPENVOX_VERSION', ENV.fetch('PUPPET_VERSION', ['>= 8.0.0', '< 9.0.0']))
gem 'pry-byebug', '~> 3.10.0'
gem 'puppetlabs_spec_helper', '>= 4.0.0', '< 9.0.0'
gem 'syslog' # Required for Ruby >= 3.4
end

Expand Down
25 changes: 17 additions & 8 deletions lib/simp/beaker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ def ensure_fixture_modules
if missing_modules.empty?
puts ' == all fixture modules present'
else
cmd = 'bundle exec rake spec_prep'
puts " -- running spec_prep: '#{cmd}'"
cmd = 'bundle exec rake fixtures:prep'
puts " -- running fixtures:prep: '#{cmd}'"
`#{cmd}`
end
end
Expand Down Expand Up @@ -1426,16 +1426,25 @@ def latest_puppet_agent_version_for(puppet_version, puppet_collection_name = 'pu
# install version and a puppet collection are specified. This is
# because the puppet install version can specify more precise
# version information than is available from a puppet collection.
#
# Each Puppet-named environment variable has an OpenVox-named
# equivalent (e.g. OPENVOX_VERSION, BEAKER_OPENVOX_COLLECTION) that
# takes precedence; the Puppet-named variables are kept as fallbacks
# for backwards compatibility.
def get_puppet_install_info
# The first match is internal Beaker and the second is legacy SIMP
puppet_install_version = ENV['BEAKER_PUPPET_AGENT_VERSION'] || ENV['PUPPET_INSTALL_VERSION'] || ENV['PUPPET_VERSION']
# OpenVox-named variables win; the Puppet-named ones remain as fallbacks.
# Within each pair the first match is internal Beaker, the second legacy SIMP.
puppet_install_version =
ENV['BEAKER_OPENVOX_AGENT_VERSION'] || ENV['BEAKER_PUPPET_AGENT_VERSION'] ||
ENV['OPENVOX_INSTALL_VERSION'] || ENV['PUPPET_INSTALL_VERSION'] ||
ENV['OPENVOX_VERSION'] || ENV['PUPPET_VERSION']

if puppet_install_version && !puppet_install_version.strip.empty?
puppet_agent_version = latest_puppet_agent_version_for(puppet_install_version.strip)
end

if puppet_agent_version.nil?
if (puppet_collection = ENV['BEAKER_PUPPET_COLLECTION'] || host.options['puppet_collection'])
if (puppet_collection = ENV['BEAKER_OPENVOX_COLLECTION'] || ENV['BEAKER_PUPPET_COLLECTION'] || host.options['puppet_collection'])
raise("Error: Puppet Collection '#{puppet_collection}' must match /(puppet|openvox)(\\d+)/") unless puppet_collection =~ %r{(puppet|openvox)(\d+)}
puppet_collection_name = ::Regexp.last_match(1)
puppet_install_version = "~> #{::Regexp.last_match(2)}"
Expand All @@ -1453,18 +1462,18 @@ def get_puppet_install_info
{
puppet_install_version: puppet_agent_version,
puppet_collection: puppet_collection,
puppet_install_type: ENV.fetch('PUPPET_INSTALL_TYPE', 'agent')
puppet_install_type: ENV['OPENVOX_INSTALL_TYPE'] || ENV.fetch('PUPPET_INSTALL_TYPE', 'agent')
}
end

def run_puppet_install_helper_on(hosts)
block_on hosts, run_in_parallel: true do |host|
puppet_collection = ENV.fetch('BEAKER_PUPPET_COLLECTION', nil) || host.options['puppet_collection']
puppet_collection = ENV['BEAKER_OPENVOX_COLLECTION'] || ENV.fetch('BEAKER_PUPPET_COLLECTION', nil) || host.options['puppet_collection']
if is_windows?(host)
install_msi_on(host, puppet_collection)
else
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, puppet_collection)
package_name = ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.collection2packagename(host, puppet_collection))
package_name = ENV['BEAKER_OPENVOX_PACKAGE_NAME'] || ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.collection2packagename(host, puppet_collection))
host.install_package(package_name)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/beaker_helpers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
module Simp; end

module Simp::BeakerHelpers # rubocop:disable Style/OneClassPerFile
VERSION = '2.0.5'
VERSION = '3.0.0'
end
4 changes: 2 additions & 2 deletions lib/simp/rake/beaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'fileutils'
require 'beaker/tasks/rake_task'
require 'beaker-rspec/rake_task'
require 'puppetlabs_spec_helper/tasks/fixtures'
require 'puppet_fixtures/tasks'

# Simp namespace
module Simp; end
Expand Down Expand Up @@ -111,7 +111,7 @@ def initialize(base_dir) # rubocop:disable Lint/MissingSuper
'default_run' : <true|false> => Default: false
```
EOM
task :suites, [:suite, :nodeset] => ['spec_prep'] do |_t, args|
task :suites, [:suite, :nodeset] => ['fixtures:prep'] do |_t, args|
suite = args[:suite]
nodeset = args[:nodeset]

Expand Down
1 change: 1 addition & 0 deletions simp-beaker-helpers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'docker-api', ['>= 2.1.0', '< 3.0.0']
s.add_runtime_dependency 'highline', ['>= 2.0', '< 4.0.0']
s.add_runtime_dependency 'nokogiri', '~> 1.8'
s.add_runtime_dependency 'puppet_fixtures', ['>= 0.1', '< 3.0.0']

### s.files = Dir['Rakefile', '{bin,lib,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z .`.split("\0")
s.files = %x(git ls-files).split("\n")
Expand Down
45 changes: 45 additions & 0 deletions spec/lib/simp/beaker_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,15 @@ def initialize

context '#get_puppet_install_info' do
after(:each) do
ENV['BEAKER_OPENVOX_AGENT_VERSION'] = nil
ENV['BEAKER_PUPPET_AGENT_VERSION'] = nil
ENV['OPENVOX_INSTALL_VERSION'] = nil
ENV['PUPPET_INSTALL_VERSION'] = nil
ENV['OPENVOX_VERSION'] = nil
ENV['PUPPET_VERSION'] = nil
ENV['BEAKER_OPENVOX_COLLECTION'] = nil
ENV['BEAKER_PUPPET_COLLECTION'] = nil
ENV['OPENVOX_INSTALL_TYPE'] = nil
ENV['PUPPET_INSTALL_TYPE'] = nil
end

Expand Down Expand Up @@ -222,6 +227,46 @@ def initialize
expect(helper.get_puppet_install_info).to eq expected
end

it 'extracts info from OPENVOX_VERSION' do
allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
ENV['OPENVOX_VERSION'] = '5.5.0'
expected = {
puppet_install_version: '5.5.0',
puppet_collection: 'puppet5',
puppet_install_type: 'agent'
}
expect(helper.get_puppet_install_info).to eq expected
end

it 'extracts openvox info from BEAKER_OPENVOX_COLLECTION' do
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
ENV['BEAKER_OPENVOX_COLLECTION'] = 'openvox8'
expected = {
puppet_install_version: '8.19.2',
puppet_collection: 'openvox8',
puppet_install_type: 'agent'
}
expect(helper.get_puppet_install_info).to eq expected
end

it 'prefers BEAKER_OPENVOX_COLLECTION over BEAKER_PUPPET_COLLECTION' do
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
ENV['BEAKER_OPENVOX_COLLECTION'] = 'openvox8'
ENV['BEAKER_PUPPET_COLLECTION'] = 'puppet5'
expected = {
puppet_install_version: '8.19.2',
puppet_collection: 'openvox8',
puppet_install_type: 'agent'
}
expect(helper.get_puppet_install_info).to eq expected
end

it 'extracts info from OPENVOX_INSTALL_TYPE' do
ENV['OPENVOX_INSTALL_TYPE'] = 'pe'

expect(helper.get_puppet_install_info[:puppet_install_type]).to eq('pe')
end

it 'extracts info from PUPPET_INSTALL_TYPE' do
ENV['PUPPET_INSTALL_TYPE'] = 'pe'

Expand Down