-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add experimental infrastructure for testing custom facts #32
base: main
Are you sure you want to change the base?
Conversation
This looks to me. Ideally, we (eventually) should be able to expand further onto this to increase the coverage of our testing on this tool. If you set it as ready for review and CI passes green, I should be able to merge this, @ekohl. |
|
||
private | ||
|
||
# TODO: duplicates adapter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Rspec::Puppet::Support
should be split into a base adapter that also applies to facts and one that includes a catalog. Then you can call setup_puppet
properly there. However, that's a larger effort I don't have time for now.
This adds testing of custom facts by placing them in spec/facts, similar to how classes have spec/classes and defines have spec/defines. The subject is also set in the same way. It is possible to stub other facts using a facts block and facts are properly cleared before and after a run.
I'd for now label it as experimental, but it's a solid base to build on. |
Hey @ekohl, we are looking again at this PR again. The idea sounds good to us but it looks like it still has some TODOs before it can be merged. We are setting this one at a draft for a while so it reflects better the state of the PR. Let us know when this PR is ready. |
That's fair. I don't see myself having time in the short term, so if anyone feels like taking this over they should feel welcome to. |
This adds testing of custom facts by placing them in spec/facts, similar to how classes have spec/classes and defines have spec/defines. The subject is also set in the same way. It is possible to stub other facts using a facts block and facts are properly cleared before and after a run.
Currently it still has a few TODOs, but the basic functionality works. I'm looking for feedback on the general design (as a user of rspec-puppet, or in other words, a module author) and specific implementation details.