Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Puppet settings to match Puppet 8 defaults #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions lib/voxpupuli/test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works with rspec-puppet-facts. See puppetlabs/rspec-puppet#41 as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work on Puppet 6 as well? Can you maybe raise a PR against puppet-example that tests this?

Puppet[:strict_variables] = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think strict_variables and strict is already set somewhere, maybe in puppetlabs_spec_helper. Setting it here probably won't hurt.

Puppet[:strict] = :error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting doesn't appear to exist in rspec-puppet.


if ENV['DEBUG']
Puppet::Util::Log.level = :debug
Puppet::Util::Log.newdestination(:console)
Expand Down