voxpupuli / onceover

Your gateway drug to automated infrastructure testing with Puppet
141 stars 45 forks source link

According to README, default value for `manifest` option is nil #292

Closed neomilium closed 3 years ago

neomilium commented 3 years ago

Since 3.9.0, manifest option is set to 'manifests/` directory which is different from README instructions.

Reading git logs, we could see:

If, for some reason, you want onceover to avoid compiling your environment's site manifests, set :manifest to a non-existent path

IMHO, using a non-existent path is not relevant.

smortex commented 3 years ago

IMHO, using a non-existent path is not relevant.

Yes it's weird :frowning:.

I am still not sure about the best way to fix it. A quick fix for me was to set it to manifests/site.pp (which exist) but move the default node configuration in a separate file (i.e. site/default.pp), so that onceover only catch the default values set in site.pp but since Puppet concatenate all stanzas from files in the site directory, the behavior does not change when applying catalogs. But this is annoying because by convention I expect manifests/site.pp to both include the default node and the default settings.

smortex commented 3 years ago

In a way, the new behavior of taking manifests/* into account seems fine-ish, but this deserve a major version bump I think since after update, onceover acts differently and does not test the same thing as before…

Ignoring node default { ... } from these files would probably help avoiding this and still make sense since the goal of onceover is to harness test roles & profiles?

neomilium commented 3 years ago

In a way, the new behavior of taking manifests/* into account seems fine-ish, but this deserve a major version bump I think since after update, onceover acts differently and does not test the same thing as before…

3.9.0 version already acts differently as before… this patch allow to back to normal.

neomilium commented 3 years ago

Ignoring node default { ... } from these files would probably help avoiding this and still make sense since the goal of onceover is to harness test roles & profiles?

Ignoring node default { ... } could be a solution but onceover did not handle manifest/ internally and rely on rspec-puppet to do it: https://github.com/dylanratcliffe/onceover/blob/master/templates/spec_helper.rb.erb#L32

neomilium commented 3 years ago

Need to verify this but with this patch, it allow to set manifest per class_groups. This way you can test roles and profiles without manifest/ and test other things with it.

dylanratcliffe commented 3 years ago

Fixed in 3.19.1