(PUP-11752) Fix fqdn_rand_string_spec.rb test#1308
Merged
bastelfreak merged 1 commit intopuppetlabs:mainfrom Apr 21, 2023
Merged
(PUP-11752) Fix fqdn_rand_string_spec.rb test#1308bastelfreak merged 1 commit intopuppetlabs:mainfrom
bastelfreak merged 1 commit intopuppetlabs:mainfrom
Conversation
bastelfreak
previously approved these changes
Apr 21, 2023
Since Puppet `7.23.0` `fqdn_rand` uses the modern structured `networking` fact instead of the legacy `fqdn` fact. In this commit we mock the new fact if using `7.23.0` or later. This is a rebase of puppetlabs#1294 and incorporates Aria Li's original change and a variation on Josh Cooper's suggestion for keeping compatibility with Puppet < `7.23.0`
ekohl
reviewed
Apr 21, 2023
Collaborator
ekohl
left a comment
There was a problem hiding this comment.
Would it make sense to just mock fqdn_rand, rather than the implementation detail of how it's determined?
Collaborator
Author
If you want, but this issue has been open for a couple of months with no fix being merged. https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good Same argument could be made for my |
bastelfreak
approved these changes
Apr 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Puppet
7.23.0fqdn_randuses the modern structurednetworkingfact instead of the legacyfqdnfact.In this commit we mock the new fact if using
7.23.0or later.Rebase of #1294 incorporating @joshcooper 's suggestion.