From 948849b362d7d32df4a477f44a15ff2c506f2c2d Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Thu, 6 Aug 2026 12:35:23 -0500 Subject: [PATCH] Compare facterversion against installed facter in acceptance test ensure_puppet_facts_can_use_facter.rb asserted that the facterversion fact reported a major version of at most 5. Hardcoding the major version breaks on every openfact major bump -- openfact 6.0.0 shipped in openvox-agent 9.0.0~beta2 made the test fail on all 11 platforms in acceptance run 31098859281 (openvox-agent suite). Compare the fact against the output of facter --version on the agent instead, which expresses what the test actually cares about (puppet facts uses the bundled facter) and survives future major bumps. Verified on a local beaker rig against openvox-agent 9.0.0~beta2 (openfact 6.0.0): the unmodified test fails with the same Minitest assertion as the pipeline; with this change it passes. Signed-off-by: Steven Pritchard Co-authored-by: Claude Fable 5 --- .../tests/ensure_puppet_facts_can_use_facter.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb b/packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb index c35fae509e..99f20c54c8 100644 --- a/packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb +++ b/packaging/acceptance/tests/ensure_puppet_facts_can_use_facter.rb @@ -4,9 +4,14 @@ agents.each do |agent| step 'test puppet facts with correct facter version' do + # Compare against the installed facter rather than a hardcoded major + # version, which broke on every openfact major bump (4 -> 5 -> 6). + installed_version = on(agent, facter('--version'), :acceptable_exit_codes => [0]).stdout.strip on(agent, puppet('facts'), :acceptable_exit_codes => [0]) do |result| - facter_major_version = Integer(JSON.parse(result.stdout)["facterversion"].split('.').first) - assert(5 >= facter_major_version, "wrong facter version") + facterversion = JSON.parse(result.stdout)["facterversion"] + assert_equal(installed_version, facterversion, + "puppet facts reported facterversion #{facterversion.inspect}, " \ + "but the installed facter is #{installed_version.inspect}") end end