chore(ci): GitHub Actions + 39 broken wiring tests rewrite#450
Merged
chore(ci): GitHub Actions + 39 broken wiring tests rewrite#450
Conversation
Why this exists: until today, sidequest-api had ZERO automated CI
(no .github/workflows/ directory anywhere in the project). Every
"this passes locally" claim was unverified. As a result,
`cargo test -p sidequest-server --test integration` ran at
367 passed / 37 failed for unknown duration — broken tests landed
and stayed landed because nothing automated refused them.
This commit is the structural fix:
1. .github/workflows/ci.yml — runs fmt + clippy + workspace test on
every PR to develop/main and every push to develop. Concurrency
group cancels superseded runs. Caches cargo via Swatinem/rust-cache.
30-minute timeout. With this in place, the next 39 broken tests
cannot land the same way.
2. TECH_DEBT.md — catalogs the 39 newly-ignored tests with retirement
strategies (Group A: rewrite as behavior tests, Group B: cheap
source-path update, Group C: delete, Group D: idempotent
init_tracing). Status table tracks the count.
3. 39 #[ignore] annotations across 12 test files. All 39 failures
were source-string assertions broken by ADR-063 dispatch
decomposition (functions moved out of dispatch/mod.rs into
dispatch/{persistence,npc_registry,...}.rs while the tests still
include_str! the old paths). One — init_tracing — is a different
class: tracing's global subscriber can only be installed once per
process, so any test after the first sees "subscriber already set"
and panics under the c662c65 consolidated binary.
4. cargo fmt --all auto-fix on two pre-existing drift sites:
sidequest-server/src/lib.rs (mod declaration ordering from PR #446
left an out-of-order entry) and a sidequest-agents test file. Both
are pure whitespace / sort fixes. They would have failed the new CI
workflow on day one if not fixed here.
Result: 379 passed; 0 failed; 43 ignored
Was: 367 passed; 37 failed; 4 ignored
Honest green: the suite reports green because broken tests are
explicitly excluded with tracking comments, not because failures
are hidden. Each #[ignore] carries a one-sentence explanation
referencing TECH_DEBT.md and a clear retirement path.
NB: this branch is independent of feat/lobby-picker-treatment. The
lobby work and the test-debt work are intentionally on separate
branches so each can be reviewed and merged on its own merits.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces the placeholder #[ignore] triage from the previous commit with
real fixes. The 39 broken tests fall into three categories, all addressed:
1. Source-grep tests pointing at moved files (32 tests) — fixed by a
new `tests/integration/test_helpers.rs` that concatenates all
`src/dispatch/*.rs` files at compile time via `include_str!`. Each
test now scans the combined dispatch (or full server) source instead
of a single file. Robust to ADR-063-style refactors.
2. Naive `#[cfg(test)]` stripping that chopped lib.rs at line 7 — fixed
by removing the strip from the helper. lib.rs declares test sub-modules
at the top with one-line `#[cfg(test)] mod xxx_tests;` declarations,
so `.split("#[cfg(test)]").next()` discarded the entire production
body. Wiring assertions search for substrings unique enough that
incidental test-code matches are not a real risk.
3. Real production gaps (3 tests) — fixed in production code:
- `init_tracing` made idempotent via `try_init()` instead of `init()`,
so the consolidated test binary can call it from multiple tests
without panicking on second-call (tracing_setup.rs)
- `seed_lore_from_char_creation` wired into dispatch_character_creation
in connect.rs, before `*builder = None`. Was a real production gap:
the function existed in sidequest-game with unit tests but had no
production caller, so character creation lore was being lost.
Tests deleted because they asserted obsolete architecture (5):
- 3 telemetry_story_18_1 tests for `turn.system_tick.combat` (sub-span
removed in story 28-9 when process_combat_and_chase was deleted)
- 2 lore_embedding tests for the per-turn retry sweep (replaced by
long-running lore_embed_worker.rs background task)
- 1 canonical_snapshot test for the abandoned DispatchContext.snapshot
field (the per-field shape that actually shipped works correctly,
confirmed by the persist_game_state tests in the same file)
Result: 412 passed; 0 failed; 4 ignored
Was: 367 passed; 37 failed; 4 ignored
The 4 remaining `#[ignore]`s pre-date this branch and are not introduced
by this work. TECH_DEBT.md updated to reflect the fix and document the
process rules: no new include_str! source-grep tests pointing at single
files, use the helper.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Test plan
cargo test --workspacegreen locally🤖 Generated with Claude Code