test(e2e): seed setup in e2e-up so local runs match CI - #708
Merged
Conversation
The workflow creates the admin account in its own step; the local script never did. POST /setup is what seeds changelog_last_seen_version, so without it should_show() returns True and the What's-new modal auto-opens 800ms after every page load. showModal() makes the page inert, and the suite's clicks are intercepted from then on. It reads as a flake. Teardown was also only clearing the host path. Docker Desktop on macOS keeps bind-mount contents inside its VM, so the container's /data survived e2e-down and every later stack inherited a completed setup. Clear it through a container so teardown means the same thing on Linux and macOS. Also wait for HTMX to settle after the second instance toggle, matching the first. The delete click otherwise follows a row swap with no settle wait. Closes #706
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.
Summary
just e2e-upnever created the admin account, while.github/workflows/browser-e2e.ymldoes it in a dedicated step. That singledifference makes a local stack diverge from CI in a way that reads as a flaky
test.
POST /setupis what seedschangelog_last_seen_version. Without it,should_showreaches_parse_version(None) is Noneand returnsTrue, sobase.htmlpulls the What's-new modal 800 ms after every page load andchangelog.jsopens it withshowModal(), which makes the rest of the documentinert. Every click the suite issues after that is intercepted:
Teardown had a second, compounding problem. It only removed the host path, but
Docker Desktop on macOS keeps bind-mount contents inside its VM, so the
container's
/datasurvivedjust e2e-downuntouched. The stack I hit this onwas still carrying a
houndarr.masterkeydated 18 July across many teardowns,which is why setup kept returning 302 and the marker was never seeded.
Closes #706
Changes
_upcreates the admin account after the health check, mirroring theworkflow. A 303 means it was created; a 302 means this stack inherited a
database, and the warning says so and points at
just e2e-down. That statuscode is the only reliable signal, because on macOS the host copy of
DATA_DIRlooks empty even when the container's/datais not._teardownclears the data directory through a container before thehost-side
rm, so teardown means the same thing on Linux and macOS. Theexisting
DATA_DIRoverride guard is unchanged, so a custom directory isstill left alone.
test_instance_toggle_and_delete_keeps_layout_stablewaits for HTMX to settleafter the second toggle, matching the first. The delete click otherwise
follows a row swap with no settle wait. This one is hardening rather than a
fix for an observed failure.
No application code changes.
setup_postreturning 302 when setup is completeis correct, and the popup behaviour is correct; the local script simply did not
do what the workflow does.
Testing
The before/after is deterministic rather than a race. On the stale stack,
test_instance_toggle_and_delete_keeps_layout_stablefailed 3 runs out of 4.After
just e2e-down && just e2e-upwith these changes:and the full chromium file passes twice, 18 of 18 both times.
The acceptance criteria check out directly. Teardown now empties the container's
/data(verified by mounting it from a throwaway container),e2e-upreportsadmin account created, and the popup endpoint returns the empty slot ratherthan modal markup:
bash -nandshellcheckare clean on the script.ruff checkandruff format --checkpass. Skipping pytest: the diff is a shell script plus onee2e-only line, and no unit test covers either. CI runs the three-engine matrix.
Type of Change
fix:)feat:)refactor:)docs:)ci:)chore:)Checklist
Closes #Ntype:*and onepriority:*labelphase:*label (or none when not roadmap work)feat/<slug>,fix/<slug>, etc.)mypy src/)ruff check .)ruff format --check .)