When writing a Puppet RSpec test, I want to be able to specify the WMCS hiera lookup order for profiles and other classes that are designed to only be used in WMCS and not in the production realm.
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T294906 Puppet Improvements | |||
| Open | None | T285539 Easing pain points caused by divergence between cloudservices and production puppet usecases | |||
| Open | None | T289668 Add more rspec test to the puppet code | |||
| Open | None | T296327 Allow using WMCS hiera lookup order in Puppet rspec tests |
Event Timeline
@Majavah I have had a think about this and i don't think that it will work as expected. Currently the shared spec helper is designed to set up an environment once and then run all rspec tests with that the same environment. i.e. its not designed to be able to switch configuration such as the hiera structure mid way through or on a per module basis (and would be even harder to do on a per class/define bases i.e. for specific profiles)
For now i think the best way forward would be to either specify the parameters directly in the spec file (which is a fairly common practice anyway) or simply add sane default values to the production hiera structure i.e. under hieradata/common/
Ill leave this open for a bit in case @dcaro or anyone else has any further thoughts