Add experimental infrastructure for testing custom facts#32
Add experimental infrastructure for testing custom facts#32ekohl wants to merge 1 commit intopuppetlabs:mainfrom
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.
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.