From 311e1b9206457ff2bbff3616c2d59051328c4662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Mon, 13 Mar 2023 12:57:36 -1000 Subject: [PATCH] Adjust Puppet settings to match Puppet 8 defaults Puppet 8 will ship without legacy facts and with strict mode enabled by default. Adjust CI settings to match this configuration for all versions of Puppet in order to match the most stict and less permissive configuration. This is expected to help detecting some issues even before Puppet 8.0.0 is released. --- lib/voxpupuli/test/spec_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/voxpupuli/test/spec_helper.rb b/lib/voxpupuli/test/spec_helper.rb index 6022b13..d51b29f 100644 --- a/lib/voxpupuli/test/spec_helper.rb +++ b/lib/voxpupuli/test/spec_helper.rb @@ -22,6 +22,16 @@ end end +# Puppet 8 remove Legacy Facts and enable Strict Mode: +# https://github.com/puppetlabs/puppet/wiki/Puppet-8-Compatibility#legacy-facts +# https://github.com/puppetlabs/puppet/wiki/Puppet-8-Compatibility#strict-mode +# +# We want to use these settings as a common denominator for all versions of +# Puppet with test modules against. +Puppet[:include_legacy_facts] = false +Puppet[:strict_variables] = true +Puppet[:strict] = :error + if ENV['DEBUG'] Puppet::Util::Log.level = :debug Puppet::Util::Log.newdestination(:console)