Repository navigation
test: run the m1 test coverage audit - #55
Merged
Merged
Conversation
Quest-Claim: cbda28fe9ec526f8
Mock the clock for session and login-code expiry instead of hand-forging expired JWTs, wait on the token signal instead of draining timers, and cover the upload cleanup for an account deleted mid-update. Add follow-up quests for Space gesture tests and a room-page browser smoke, and plan the next run in m2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 26, 2026 06:56
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Problem
First run of the
testsaudit in this repo (quest audit tests).Findings
Coverage baseline (measured with
bun test --coverageper CI suite; the tooling isn't committed):api: 41 tests.account.ts92%,auth.ts97%,avatar.ts97%,oauth.ts94%,storage.ts96%,room.ts84%. The uncovered part ofroom.tsis the join route, which belongs to the openroom-token-identityPR (fix(room)!: bind guest identities and expire room tokens #53), so this PR doesn't touch it.app: 57 tests. The pure modules (capture,speaker,room/peers,room/physics,room/sanitize,room/preview) are at 100% androom/metadatais at 98%. No suite loadsroom/space.ts, the WebGL renderers,room/watch.ts,video.ts,audio.ts,chat.ts, or most page components. Onlytest/media.browser.tsreaches capture and decode.Unreachable tests: none. Every test file runs in
just check, which usesset -euo pipefail. There are no skipped, todo, or env-gated tests.moq/suites are upstream's.Wall-clock tests (all fixed here):
api/test/auth.test.tsandapi/test/oauth.test.tshand-forged expired JWTs fromDate.now(). Those copies of the token format could drift from whatAuth.Contextactually mints. They now mint real tokens and codes undersetSystemTimeand pin the session lifetime (one year) and the code lifetime (five minutes) at the boundary.app/src/api.test.tswaited with 10 rounds ofsetTimeout(0). It now awaitsSettings.oauth.token.changed(), set up before the client loads.Missing regression tests: fixes merged since #43 that changed no test:
None of these has a seam today, so each is a follow-up below.
Drifted mirrors:
Bucketmatches whatstorage.tscalls.room. A missing field fails loudly in tests, so this PR leaves it.Gap fixed here: an avatar uploaded for an account that was deleted mid-update was untested. A session token outlives its account. A new test checks that the upload is deleted rather than orphaned in R2.
I mutation-checked each new API test: it fails when the lifetime or the cleanup line it covers is changed.
Space seam
Driving
Spacein happy-dom would mean fakingAudioContext, the chat worker, and the video pipeline throughBroadcast, which costs too much for what it would catch. The recommended seam is to extract the gesture state machine into a pure module, the waypeers.tsandphysics.tswere extracted, and unit-test that. The rendering half goes to a real-browser smoke test built on the existing Playwright and relay harness.Impact
Tests and quests only. No public API or wire change.
Follow-ups
Spaceand unit-test fix(room): make Remote Control stop others from moving you #51's cases.media.browser.tsto render a room, survive WebGL context loss, and fall back without WebGL2.Validation
quest gate just checkpasses:quest check, tsc, Biome, 41 API tests, 57 app tests, and the media browser test.just buildwas not run locally because the build output doesn't include tests. CI runs it.Models
Size: M
Implementer: Claude Code, claude-opus-5-5, high
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: bc7cdee
Base: origin/main at 6a3af10
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.2-sol, high effort
Session:
01a216a0-148c-7d72-8b32-98c949f78ed6, round 2Score: 10/10,
The avatar test deletes the account during the upload, the authentication test waits for the state change before asserting it, and neither revision introduces a new finding.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none