Repository navigation
ci: fail when the UI test fixture is out of date - #523
Merged
Merged
Conversation
The frontend tests read hyperglass/ui/__tests__/fixtures/config.json, which .tests/ui-fixture/generate.py builds from the backend models. When the UI parameters change and nobody regenerates it, the frontend tests keep passing against parameters the real UI build no longer receives. The backend job now regenerates the fixture on one Python version and fails with a hint if the committed file differs. #508 made the output deterministic, so an unchanged tree regenerates byte for byte. CONTRIBUTING documents the regeneration step.
WilhelmZA
approved these changes
Nov 20, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
Approving at 06f3a1d0.
The "Check the UI test fixture" step runs on the Python 3.12 backend leg after the dependencies are installed, and it passed in the CI run for this commit. It adds no trigger, permission or dependency change. Both "Done when" items of #522 are met, so Closes #522 is right. The commit is verified and CI gate passes.
#528 changes the same two files, .github/workflows/ci.yml and CONTRIBUTING.md. Whichever merges second needs a check that this step and the "Local checks" paragraph are still in place.
Nits:
- The description says Actions runs
run:withbash -eo pipefail. Without an explicitshell:, the default isbash -e {0}. The step has no pipe, so the result is the same.
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.
Closes #522
Problem
The frontend tests read
hyperglass/ui/__tests__/fixtures/config.json, which.tests/ui-fixture/generate.pybuilds from the backend models (#504). Nothing checked that the committed file is current, so a change to the UI parameters could leave the frontend tests passing against parameters the real UI build no longer receives.Change
ci.yml, backend job, Python 3.12 only: a "Check the UI test fixture" step after lint. It runs the generator and fails with an error annotation and the regeneration command ifgit diffshows a change. The generator uses fakeredis and 192.0.2.0/24 addresses, so it needs neither the Redis service nor DNS. The job installs the project in editable mode, so it importshyperglasswithoutPYTHONPATH.CONTRIBUTING.md: under "Local checks", when and how to regenerate the fixture.Tests
Ran the step's commands locally on this branch:
git diff --exit-codepasses.web.text.title: Driftedin.tests/ui-fixture/config.yamlwithout committing a new fixture:config.json | 2 +-, so the step fails.If the generator itself fails, the step fails too, because Actions runs
run:withbash -eo pipefail.Changelog
Notes
Only the 3.12 leg runs the check. The output doesn't depend on the Python version, and one failure is enough.