test: close skipped-test coverage gaps (Media Center service + presence-DO roster) - #204
Merged
important-new merged 2 commits intoJun 25, 2026
Conversation
…ce-DO roster)
The unit suite carried 8 skips that masked real gaps:
- Media Center (7): the InspectionPhotoService aggregation / pool upload /
attach-move+append / delete+R2 / tenant-isolation logic was untested in CI
(only the client-side flattenMedia helper was covered). The suite was
describe.skip'd because the fixture omitted the ScopedDB (sdb) constructor
arg, so the sdb-backed cases threw. Wire a ScopedDB over the test db and
un-skip; 5 passed immediately, 2 had STALE url assertions (/photos/{key} →
the current /api/inspections/:id/photo?key={key} from the Hono catch-all
fix) — corrected. Now 7/7.
- Presence DO (1): the node-env placeholder was an empty it.skip stub
(asserts nothing). Add real workerd-runtime coverage in
tests/workers/presence-do.spec.ts (bind INSPECTION_PRESENCE in the
vitest-pool-workers config + re-export from test-worker.ts): a 2nd client
joining broadcasts an updated roster to the first; close broadcasts a roster
without the departed user; an upgrade with no x-user-id is rejected (401).
Removed the empty placeholder; the node file keeps its binding-contract checks.
Result: test:unit 2169 passed (0 skipped, was 8) · test:workers 69 (was 66)
· test:web 590 · type-check 0/0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
…clone slugs)
The "makes default flag mutually exclusive" test cloned twice back-to-back
without explicit slugs; clone()'s default slug is `${src}-copy-${Date.now()}`,
so two clones in the same millisecond collided → the 2nd create hit the
slug-uniqueness guard → flaky failure (~1/3, including this PR's CI run).
Pass explicit distinct slugs. Verified deterministic: 8/8 local runs pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
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.
The unit suite carried 8
describe.skip/it.skipcases that masked real gaps. This un-skips/closes them — test-only, no runtime change.Media Center service layer (7)
InspectionPhotoServiceaggregation / pool upload / attach-move+append / delete+R2 / tenant-isolation was untested in CI (only the client-sideflattenMediahelper was covered). The suite was skipped because the fixture omitted theScopedDB(sdb) constructor arg, so the sdb-backed cases threw. Wired aScopedDBover the test db and un-skipped: 5 passed immediately; 2 had stale URL assertions (/photos/{key}→ the current/api/inspections/:id/photo?key={key}from the Hono mounted-router catch-all fix) — corrected. Now 7/7.Presence DO roster broadcast (1)
The node-env case was an empty
it.skipplaceholder (asserted nothing). Added real workerd-runtime coverage intests/workers/presence-do.spec.ts(boundINSPECTION_PRESENCEin the vitest-pool-workers config + re-exported the DO fromtest-worker.ts):/wsupgrade with nox-user-idis rejected (401).Removed the empty placeholder; the node file keeps its binding-contract checks.
Result
test:unit2169 passed, 0 skipped (was 2162 passed | 8 skipped) ·test:workers69 (was 66) ·test:web590 · type-check 0/0 · lint/DS/migref/bundle green.🤖 Generated with Claude Code