Repository navigation
fix(ci): repair PlaybackApiTest and drop source-grep pseudo-tests - #102
Conversation
CI has been red since 27de43a. That commit added direct_stream_resume_v1 to the client feature list sent on POST /api/v1/playback/start, but PlaybackApiTest asserted against a hardcoded copy of the previous six-item list. The production code was correct; the test was stale. Extract the list into PLAYBACK_START_CLIENT_FEATURES_V3 so the request model and the test share one definition, and adding a feature can no longer break the assertion. Also remove 97 test files that read production .kt files as plain text and asserted on substrings: private val source = File("src/androidMain/.../TvHomeScreen.kt").readText() @test fun x() { assertTrue(source.contains("TvSkylineSectionFeed(")) } None of them imported a production symbol, so none executed app code. They passed when a matching string sat in a comment or a dead branch, failed on renames and reformats, and accounted for 121 commits of churn over the last three months. Two files that mixed these greps with real behavioural tests were rewritten to keep only the real ones. Kept: the tree-walk lint checks (e.g. the TV 14sp typography floor) and the manifest/asset policy tests, which read XML rather than Kotlin. Finally, run only testDebugUnitTest in CI. The release variant compiled and ran identical sources for no extra signal. Verified: 2097 tests, 0 failures, 20.6s execution. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (103)
📝 WalkthroughWalkthroughAndroid CI now runs debug unit tests, many source-inspection tests are removed, reader routing receives behavioral coverage, and the V3 playback client-feature list is centralized for production defaults and API assertions. ChangesTest suite updates
Playback feature contract
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 300d9296cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assertEquals( | ||
| listOf( | ||
| "playback_plan_v3", | ||
| "media3_only", | ||
| "detailed_decode_capabilities", | ||
| "client_video_transformations_v1", | ||
| "device_quirks_v1", | ||
| "seek_reanchor_v1", | ||
| ), | ||
| PLAYBACK_START_CLIENT_FEATURES_V3, | ||
| body["client_features"]!!.jsonArray.map { it.jsonPrimitive.content }, |
There was a problem hiding this comment.
Keep the playback feature expectation independent
The expected value now comes from the same constant that supplies PlaybackStartRequestV3.clientFeatures, so this assertion is tautological. If a later edit accidentally removes or renames direct_stream_resume_v1 (or another required negotiation token), the outgoing wire contract changes and this test still passes; keep the production constant, but assert an independently specified list of protocol tokens here.
Useful? React with 👍 / 👎.
| assertFalse(source.contains("SET_ENGINE")) | ||
| assertFalse(source.contains("switchEngine")) | ||
| assertFalse(source.contains("createMpvPlayer")) |
There was a problem hiding this comment.
Run the Media3-only checker after deleting this gate
When a later change reintroduces an MPV engine command or backend, deleting this test removes the only CI gate that previously rejected it. I checked the android-build.yml workflow and repo-wide references to scripts/check-no-mpv-runtime.sh; the workflow only runs Gradle tests and the checker is referenced from documentation, not automation. Replace this pseudo-test with a workflow step invoking that purpose-built checker so the documented Media3-only runtime invariant remains enforced.
Useful? React with 👍 / 👎.
Why CI was red
CI has failed on every run since 27de43a (2026-07-24). That commit added
direct_stream_resume_v1to the client feature list sent onPOST /api/v1/playback/start, butPlaybackApiTestasserted against a hardcoded copy of the previous six-item list:The production code was correct — the test was stale. Fixed by extracting
PLAYBACK_START_CLIENT_FEATURES_V3so the request model and the test share one definition; adding a feature can no longer break the assertion.Removing source-grep pseudo-tests
97 test files read production
.ktfiles as plain text and asserted on substrings:None imported a production symbol, so none executed a line of app code. They passed when a matching string sat in a comment or a dead branch, failed on harmless renames and reformats, and drove 121 commits of churn in three months. That's 2,182
.contains()assertions against source text.Two files that mixed these greps with genuinely behavioural tests were rewritten to keep only the real ones.
Kept deliberately: the 4 tree-walk lint checks (e.g. the TV 14sp typography floor sweep) and the manifest/asset policy tests, which read XML rather than Kotlin.
CI now runs debug tests only
./gradlew testwas building and running both the debug and release unit-test variants — identical sources, no extra signal, double the time.Verification
./gradlew testDebugUnitTest→ 2,097 tests, 0 failures, BUILD SUCCESSFUL (20.6s execution).Test execution was never the bottleneck; the 5–6 min CI time was almost entirely Kotlin/Compose compilation of test sources, which this cuts by ~7k lines on top of halving the variant work.
Reviewer notes
ReaderScreenStructureTest7:2,VideoTrackSelectionCoordinatorTest5:1). I left these alone rather than risk deleting real tests via automated splitting — a follow-up if you want it.🤖 Generated with Claude Code
Summary by CodeRabbit