Skip to content

test: close skipped-test coverage gaps (Media Center service + presence-DO roster) - #204

Merged
important-new merged 2 commits into
InspectorHub:mainfrom
important-new:chore/unskip-media-center-service-tests
Jun 25, 2026
Merged

test: close skipped-test coverage gaps (Media Center service + presence-DO roster)#204
important-new merged 2 commits into
InspectorHub:mainfrom
important-new:chore/unskip-media-center-service-tests

Conversation

@important-new

Copy link
Copy Markdown
Contributor

The unit suite carried 8 describe.skip/it.skip cases that masked real gaps. This un-skips/closes them — test-only, no runtime change.

Media Center service layer (7)

InspectionPhotoService aggregation / pool upload / attach-move+append / delete+R2 / tenant-isolation was untested in CI (only the client-side flattenMedia helper was covered). The suite was skipped because the fixture omitted the ScopedDB (sdb) constructor arg, so the sdb-backed cases threw. Wired a ScopedDB over 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.skip placeholder (asserted nothing). Added real workerd-runtime coverage in tests/workers/presence-do.spec.ts (bound INSPECTION_PRESENCE in the vitest-pool-workers config + re-exported the DO from test-worker.ts):

  • a second client joining broadcasts an updated roster to the first connection;
  • closing a connection broadcasts a roster without the departed user;
  • a /ws 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 2162 passed | 8 skipped) · test:workers 69 (was 66) · test:web 590 · type-check 0/0 · lint/DS/migref/bundle green.

🤖 Generated with Claude Code

important-new and others added 2 commits June 25, 2026 23:08
…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
@important-new
important-new merged commit 75032ce into InspectorHub:main Jun 25, 2026
4 checks passed
@important-new
important-new deleted the chore/unskip-media-center-service-tests branch June 25, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant