Run the integration tests in CI, and make the fixture check real (LC-605) #561
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lc605-ci-runs-integration-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes LC-605.
CI ran
cargo test --lib -p lets-chat-server, executing only the 266 in-crate unit tests. The 177 integration binaries underserver/tests/were compiled by the--all-targetsbuild and clippy steps but never run - so roughly 770 tests, about 74% of the 1036 that pass locally, could not fail the pipeline.Compiling them is exactly what made this invisible: a broken integration test still went green, and even a non-compiling one was caught, so the job looked like it covered them. Three long-lived breakages reached
mainthis way (LC-600, and the two below).Dropping
--libruns both sets. The marginal cost is modest because the earlier steps already compile these binaries - locally the full suite adds ~100s wall-clock over--libon a warm cache (18s vs 119s).Two blockers had to be fixed first
Enabling this without them would just have turned CI red.
1.
routes_draftsdraft-indicator testsThey matched the literal
✎. Commit06913c8("draft indicator is an SVG pencil, not a tofu dingbat") replaced that entity and did not update the tests.sidebar_shows_draft_pencil_for_room_with_drafthad been failing on main ever since.sidebar_omits_draft_pencil_when_no_draftkept passing while asserting the absence of a string that no longer appears anywhere - which is the worse failure of the two, because it read as coverage and was not.Both now assert on the badge's structure (populated indicator vs empty OOB-target span) through a small
draft_badgehelper, so the next icon change does not break them.2. The
lc77fixture check was inert locallyI reported this on the ticket as "auto-rewrites on mismatch". That was wrong, and the real cause is worth stating precisely:
dev/cargoforwards-e "FIXTURE_WRITE=${FIXTURE_WRITE:-}", which sets the variable present and empty.env::varreturnsOk(""), so the write branch fired on every local run through the standard wrapper: the golden files were silently regenerated and the test always passed. The assertion only worked under a barecargo test- i.e. nowhere anyone actually ran it, and (until this PR) nowhere in CI either.The predicate now requires a meaningful value, so the default is to assert. Verified both directions: with stale fixtures the tests fail and leave the files untouched; with
FIXTURE_WRITE=1they regenerate.The four fixtures are regenerated here to match current templates. The drift is the LC-553 reaction button and the LC-598 menu grouping - both intentional, neither previously captured.
Verification
just checkgreen.server/assets/tailwind-built.cssremoved, confirming CI needs nobuild-cssstep for it -compute_asset_versionfalls back and tests constructAppStatewithasset_version: "test".What this does not do
I have not seen this job run on the runner. The remaining risk is wall-clock and any runner-specific environment difference; the local evidence above is the best proxy I can produce from here. If the added time is a problem, the natural follow-up is splitting the integration run into its own parallel job rather than reverting to
--lib.🤖 Generated with Claude Code
https://claude.ai/code/session_01P2Lh6DKB15inZTb5z8miu7
CI has now run this on the runner, so the "I have not seen this job run" caveat above is resolved.
Check / clippy + fmt + tests (pull_request)-> success, "Successful in 5m25s", combined status success.That is the whole 1036-test suite executing on the runner rather than my local proxy for it. 5m25s is the total job wall-clock (fmt, two clippy passes, two builds, then the tests), so the added time is comfortably absorbed - no need for the split-into-a-parallel-job follow-up I suggested unless it grows later.
Worth stating plainly: this run is also the first time the integration tests have ever gated a PR in this repo.