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

rspec-puppet-facts: Require 4.x; add custom facts as strings #135

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

bastelfreak
Copy link
Member

@bastelfreak bastelfreak commented Jun 10, 2024

This basically drops factsets for facter 1, 2 and 3. So it drops support for Puppet 6 and older. However, we don't support those anymore in our modules, so this isn't a breaking change.

The newer FacterDB release also drop support for some operating systems that were EoL as well.

os: {'family' => 'RedHat', 'release' => { 'major' => '6' }}
})
expect(facts['systemd']).to be false
expect(facts[:systemd]).to be true
Copy link
Member Author

Choose a reason for hiding this comment

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

I understand that those are symbols, because we don't set RSpec.config.facterdb_string_keys = true. But why was it a string in the past? The code adds the custom fact as symbol:

add_custom_fact :service_provider, ->(_os, facts) do

also the stdlib facts below are tested as a symbol and work now and worked before 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this changedin rspec-puppet-facts 3. Previously the custom facts were always strings, now they honour stringify_facts

Copy link
Member Author

Choose a reason for hiding this comment

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

If we can switch the custom facts someone back to strings we could make this a minor release. But if we do a major release that's not too bad as well. We don't use the systemd fact at all in our unit tests for facts, it just requires a new modulesync.

Copy link
Member Author

@bastelfreak bastelfreak Jun 11, 2024

Choose a reason for hiding this comment

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

Okay I think we should do a major release

end

it 'has no systemd on openbsd' do
add_facts_for_metadata(metadata)
facts = RspecPuppetFacts.with_custom_facts('openbsd-6.4-x86_64', {
facts = RspecPuppetFacts.with_custom_facts('openbsd-7-x86_64', {
Copy link
Member Author

Choose a reason for hiding this comment

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

updating because openbsd 6.4 is gone from facterdb.

@bastelfreak bastelfreak added backwards-incompatible and removed enhancement New feature or request labels Jun 11, 2024
@bastelfreak bastelfreak changed the title rspec-puppet-facts: Require 4.x rspec-puppet-facts: Require 4.x; add custom facts as strings Jun 11, 2024
@bastelfreak bastelfreak merged commit 804bb42 into voxpupuli:master Jun 12, 2024
9 checks passed
@bastelfreak bastelfreak deleted the rpf3 branch June 12, 2024 07:32
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.

2 participants