-
Notifications
You must be signed in to change notification settings - Fork 105
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
Cannot override module Hiera 5 config for unit tests #487
Comments
A similar issue appears to have been reported here: rodjek/rspec-puppet#626 |
This should be considered alongside the addition of Hiera support in general, similar to ticket open #424 I have also been trying to unit test with rspec and hiera config files and having mixed success. It would also be helpful to have a standard directory structure where these testing Hiera files could exist, since it's up to the user to decide currently. |
@ragnarkon @ardrigh see rodjek/rspec-puppet#626 (comment) for a possible workaround. If that works for you it's easy enough to add to your |
Closing this in favor of the linked rspec-puppet ticket. Once it has been resolved there it will be included in the subsequent PDK release. |
There appears to be no way to override the module layer Hiera 5 configuration in for unit tests. Having the ability to override the Hiera 5 module layer configuration would extremely helpful, particularly when running unit tests on eyaml data where the developer (or CI pipeline) may not have access to the public/private keys.
Furthermore, if the developer did have access to the public/private keys, the hiera-eyaml gem is not included in the Gemfile by default, causing unit tests to fail. (Admittedly, an easy problem for the user to fix themselves.)
Current Behavior
Example
./hiera5.yaml
that should be overwritten:./spec/fixtures/hiera/hiera.yaml
file used for unit tests:./spec/spec_helper.rb
:The text was updated successfully, but these errors were encountered: