Skip to content

moves the check_redfish test source builder into a fixture - #546

Merged
semx merged 1 commit into
bb-Ricardo:developmentfrom
marcinpsk:test/check-redfish-source-fixture
Sep 9, 2026
Merged

semx merged 1 commit into
bb-Ricardo:developmentfrom
marcinpsk:test/check-redfish-source-fixture

Conversation

@marcinpsk

@marcinpsk marcinpsk commented Sep 7, 2026

Copy link
Copy Markdown

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 CheckRedfish through object.__new__, run the real add_necessary_base_objects(), and add a device to hang components off.

conftest.py gains a check_redfish_source fixture returning a builder.

  • It reuses the existing inventory fixture 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.
  • Settings are passed as keyword arguments, because each entry point of the source reads a different subset of them.
  • It returns the source, inventory and 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 moves the fixture closer to a real run rather than further from it.

@marcinpsk
marcinpsk force-pushed the test/check-redfish-source-fixture branch from 3c02d66 to 29c00c7 Compare September 9, 2026 16:22
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
marcinpsk force-pushed the test/check-redfish-source-fixture branch from 29c00c7 to 35f7aac Compare September 9, 2026 17:06
@semx
semx merged commit d9056ff into bb-Ricardo:development Sep 9, 2026
1 check passed
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.

2 participants