moves the check_redfish test source builder into a fixture - #546
Merged
semx merged 1 commit intoSep 9, 2026
Merged
Conversation
marcinpsk
force-pushed
the
test/check-redfish-source-fixture
branch
from
September 9, 2026 16:22
3c02d66 to
29c00c7
Compare
Both check_redfish test modules carried their own copy of the same setup: reset the inventory singleton, build a CheckRedfish through object.__new__, run the real add_necessary_base_objects(), and add a device to hang components off. Two more copies were about to arrive with the interface IP and device serial tests. conftest.py gains a check_redfish_source fixture which returns a builder. It reuses the existing inventory fixture instead of resetting the singleton again, so the reset lives in one place, and it takes the source settings as keyword arguments because each entry point of the source reads a different subset of them. It returns the source, the inventory and the device as a namespace. The primary tag is now always registered. Only the orphan tagging tests needed it, but the NetBox handler registers it in production regardless, so making it unconditional brings the fixture closer to a real run rather than further from it. No test assertion changed. Reverting either of the two fixes these modules cover still fails them, so the shared setup does not weaken what they check.
marcinpsk
force-pushed
the
test/check-redfish-source-fixture
branch
from
September 9, 2026 17:06
29c00c7 to
35f7aac
Compare
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.
I've put this fixture in previous PRs separately because there was no conftest.py yet, cleaning it up now since #541 merged.
Both check_redfish test modules carried their own copy of the same setup: reset the inventory singleton, build a
CheckRedfishthroughobject.__new__, run the realadd_necessary_base_objects(), and add a device to hang components off.conftest.pygains acheck_redfish_sourcefixture returning a builder.inventoryfixture rather than resetting the singleton again, so the reset lives in one place and check_redfish tests get the same before/after cleanup the vcsim tests already have.The primary tag is now always registered. Only the orphan-tagging tests needed it, but the NetBox handler registers it in production regardless, so making it unconditional moves the fixture closer to a real run rather than further from it.