Skip to content
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

test classes/defines using facterdb data #622

Merged
merged 3 commits into from
Aug 3, 2022
Merged

Conversation

jhoblitt
Copy link
Member

@jhoblitt jhoblitt commented Aug 1, 2022

Host/role specs were converted to use facterdb in #610 .

@jhoblitt jhoblitt marked this pull request as draft August 1, 2022 19:23
jhoblitt added a commit that referenced this pull request Aug 1, 2022
@jhoblitt jhoblitt requested a review from cbarria August 1, 2022 19:49
@jhoblitt jhoblitt marked this pull request as ready for review August 1, 2022 19:49
jhoblitt added a commit that referenced this pull request Aug 2, 2022
jhoblitt added a commit that referenced this pull request Aug 3, 2022
jhoblitt added a commit that referenced this pull request Aug 3, 2022
Copy link
Contributor

@cbarria cbarria left a comment

Choose a reason for hiding this comment

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

only thing i see is different OS test where added (on_supported_os.each)

@jhoblitt
Copy link
Member Author

jhoblitt commented Aug 3, 2022

@cbarria This is changing from test with an enormous set of centos 7 test of facts (copied from one of our production hosts) in spec/default_facts.yml to using facterdb for most test data. facterdb contains dumps of facts from all of the operatingsystems we are likely to use and saves us the effort of having to copy in test facts for EL7, EL8, etc.

The default fact set was copied from a live centos 7 instance.  A few of
these facts are incorrect for EL8, Debian, etc.  As well as being
largely unnecessary as part of the switch to using facterdb for test
fact sets.

Note that facterdb does not include facts from puppetlabs/stdlib and
that `#add_custom_fact` will need to be used `spec/spec_helper.rb` to
add os specific facts.
@cbarria
Copy link
Contributor

cbarria commented Aug 3, 2022

great! thanks for the explanation, didn't knew what facterdb does, now i know why so much declarative code went away! 👍

@jhoblitt
Copy link
Member Author

jhoblitt commented Aug 3, 2022

facterdb is a ruby gem which was already present as a dep of voxpupuli-test. https://github.com/voxpupuli/facterdb

@jhoblitt jhoblitt requested a review from cbarria August 3, 2022 19:10
jhoblitt added a commit that referenced this pull request Aug 3, 2022
Copy link
Contributor

@cbarria cbarria left a comment

Choose a reason for hiding this comment

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

thanks for the explanation on facterdb 👍

@jhoblitt jhoblitt merged commit 0d1063b into master Aug 3, 2022
@jhoblitt jhoblitt deleted the IT-3057/class-tests branch August 3, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants