You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This completely disables Facter and uses a stubbed implementation. This is
# fine since we use use rspec-puppet-facts to set all facts. It gives
# complete isolation from the host system. It only works with Puppet 6.25+
# and 7.12+ and requires rspec-puppet 2.11.0+.
config.facter_implementation='rspec'
config.after(:suite)do
RSpec::Puppet::Coverage.report!
end
end
to enforce a coverage of 100 it would need to be:
RSpec.configuredo |config|
# This completely disables Facter and uses a stubbed implementation. This is# fine since we use use rspec-puppet-facts to set all facts. It gives# complete isolation from the host system. It only works with Puppet 6.25+# and 7.12+ and requires rspec-puppet 2.11.0+.config.facter_implementation='rspec'config.after(:suite)doRSpec::Puppet::Coverage.report!(100)endend
@ekohl any ideas how we could make this configureable from a module?
The text was updated successfully, but these errors were encountered:
I'm not sure they're useful. It doesn't check coverage of your manifests, just out of the resources that ended up in catalogs which ones had any tests associated. Whole classes might have 0 tests, but if those classes weren't included by any of the tests you do have, coverage might still show 100%. Meanwhile, there's a whole lot of busy work writing often pretty pointless lines of rspec just to make this go green.
I'm also not a fan of coverage enforcement. IMHO it doesn't give any guarantees about quality. Usually it's just playing with getting numbers, not really improving anything.
pdk-templates has an option to enforce a minimal rspec-puppet coverage. We currently have this:
voxpupuli-test/lib/voxpupuli/test/spec_helper.rb
Lines 13 to 23 in 05ebb64
to enforce a coverage of 100 it would need to be:
@ekohl any ideas how we could make this configureable from a module?
The text was updated successfully, but these errors were encountered: