Page MenuHomePhabricator

Allow using WMCS hiera lookup order in Puppet rspec tests
Open, MediumPublic

Description

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.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
jbond triaged this task as High priority.Nov 23 2021, 7:12 PM
jbond lowered the priority of this task from High to Medium.
jbond added a project: User-jbond.
jbond added subscribers: dcaro, jbond.

@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