Skip to content

Write facts as shared examples, move to Debian 11 and follow rspec-puppet path conventions #1311

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

Merged
merged 6 commits into from
Feb 6, 2022

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Nov 17, 2021

rspec-puppet places all classes in spec/classes and automatically applies the correct type. The same is true for defines in spec/defines.

Previously there was a lot of duplication between facts. This now stores them as shared examples in spec_helper_local.rb and also extracts them from rspec-puppet-facts where possible.

Debian 8 isn't in metadata.json anymore which meant it was testing for an unsupported OS by default. It's now changed to Debian 11.

@ekohl ekohl requested a review from a team as a code owner November 17, 2021 10:51
bastelfreak
bastelfreak previously approved these changes Nov 17, 2021
@daianamezdrea
Copy link
Contributor

Hi @ekohl, can you rebase your PR please ? Thank you !

@ekohl
Copy link
Collaborator Author

ekohl commented Dec 23, 2021

Rebased

@ekohl ekohl force-pushed the modernize-specs branch 2 times, most recently from 9856ccf to a893b9a Compare February 3, 2022 11:13
bastelfreak
bastelfreak previously approved these changes Feb 3, 2022
Copy link
Collaborator

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. happy to merge if tests pass

@ekohl
Copy link
Collaborator Author

ekohl commented Feb 3, 2022

Looks like lint failed, but I wonder why it didn't fail before since I'm not changing that.

ekohl added 5 commits February 3, 2022 13:37
These were previously introduced and warnings weren't fatal due to a
regression in puppetlabs_spec_helper, which is probably why it was
missed.

Fixes: 64a7753
Fixes: 6aaa1cf
It doesn't accept nil for an optional parameter, it must be a boolean.
rspec-puppet places all classes in spec/classes and automatically
applies the correct type. The same is true for defines in spec/defines.
@ekohl ekohl force-pushed the modernize-specs branch 3 times, most recently from e3f2c51 to f4c53d0 Compare February 3, 2022 13:22
@ekohl ekohl marked this pull request as draft February 3, 2022 13:25
@ekohl
Copy link
Collaborator Author

ekohl commented Feb 3, 2022

Marking it as draft since I'm abusing CI to see if my code passes because of https://tickets.puppetlabs.com/browse/MODULES-11161. If the tests are green, it should be ready.

@ekohl ekohl marked this pull request as ready for review February 3, 2022 13:40
Previously there was a lot of duplication between facts. This now stores
them as shared examples in spec_helper_local.rb and also extracts them
from rspec-puppet-facts where possible.

Debian 8 isn't in metadata.json anymore which meant it was testing for
an unsupported OS by default. It's now changed to Debian 11.
@ekohl
Copy link
Collaborator Author

ekohl commented Feb 3, 2022

This is now failing on #1313 (comment). I'm hoping @fe80 can shed some light on this.

Copy link
Collaborator

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. the tests fail also on main, so I think merging it is fine.

@ekohl ekohl merged commit b3b49af into puppetlabs:main Feb 6, 2022
@ekohl ekohl deleted the modernize-specs branch February 6, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants