-
Notifications
You must be signed in to change notification settings - Fork 15
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
Refactor rspec-puppet tests #43
Comments
This was making good progress until I hit one of those impossible-for-humans-to-parse error messages that makes Puppet so fucking evil. |
Bumping to high prio because it blocks so many other things. |
I made a solid first attempt at this refactoring, but I'm seeing a persistent error that I don't understand. Since the error message itself is amazingly useless, I'm trying to debug it by reducing the difference between my changed version (broken) and master (works). Amazingly, I reduced it all the way down to a trivial test suite and saw the error at every step along the way. The simplest version of
Fails with:
Everything else is the same as master. |
This is the part of the error that I don't understand:
Line 4 of which file? Clearly not |
Started again with exactly the same Made it all the way to this with the tests still passing:
Taking the final step and removing the only difference between that code and the version described above, I end up with:
And see this failure:
Note that this is exactly the same code, and it's producing a different error message. This error makes sense, as the checks in |
One lesson learned:
But this throws errors about OS family not being set:
Errors:
|
Literally coping+pasting the code from the working example in my most recent comment, I'm now seeing that fucking Code:
Error:
|
Strange data point. This works:
This doesn't:
Error:
The difference is the inclusion of the word |
Okay, I now have a fairly substantial subset of the refactored version passing. The two important changes are removing
|
- Relevant to #43 - The word 'class' must not appear in `describe` strings - `let` statements aren't inherited by child contexts Signed-off-by: Daniel Farrell <[email protected]>
- Relevant to #43 Signed-off-by: Daniel Farrell <[email protected]>
* Only testing defaults! See #43 for reasoning. * May add this to other OSs Signed-off-by: Daniel Farrell <[email protected]>
* Only testing defaults! See #43 for reasoning. * By 'all', of course I mean 'all supported' (others fail) * Refactored RPM rspec helper fn to support Fedora * Minor doc fix Signed-off-by: Daniel Farrell <[email protected]>
The current rspec-puppet tests are pretty great, but the architecture isn't going to scale as I continue adding param combinations to test. They basically work like this at the moment:
If I add a third layer, like I need to do for #41, it would look like this:
Clearly this doesn't scale, although it provides awesome coverage (every param combo).
I think something like this would provide solid practical coverage, without covering every possible param combo:
The text was updated successfully, but these errors were encountered: