Repository navigation
test: add unit tests, the coverage gate and a render smoke test - #9
Merged
Merged
Conversation
3 tasks done
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.
Closes #5. Part of #2. Stacked on #8 (base
feat/quality-gates-ci); retarget tomasterafter #8 merges.Why
The CLI had no tests. This adds unit tests for the logic that decides what a video sounds and looks like, a render smoke test in headless Chromium, and kotobae's 80% coverage gate, all run in CI without a
GEMINI_API_KEY.What changed
@vitest/coverage-v8,vitest.config.tswith 80% thresholds (lines, branches, functions, statements).make test,make test-coverage, andmake checknow includes the coverage gate.preparemoved fromcli.tstostore.tsand throws instead of exiting.placeOnFilm(narration placement on the film timeline) moved towork.tsand reports long narration through a callback.encodeArgsinaudio.ts.cli.tsis left as command wiring and is excluded from coverage; the smoke test runs it as a real process.script.jsonvalidation: defaults and every rejection message.timing.jsonparsing.fetchmocked: URL, API key header, voice, the BGM prompt length, raw PCM to WAV, skipping unchanged scenes, three retries with the API's error message, missing key.spawnmocked: narration delays, tempo, BGM loop, volume and fades in the filter graph, and the encode arguments.preparefrom a fixture store.tests/fixtures/player, a small stand-in for the Motion player with the samewindow.__animationhook. The real player is Anthropic's Motion code and is not committed. The tests check:fetch("https://example.com/")and must see it blocked);motion-render prepare+stillsas a subprocess.make test-coverage.Verification
make checklocally: lint, format, typecheck, 48 tests pass, coverage lines 91.45% / branches 91.8% / functions 97.43% / statements 91.45%, quality gate tests, baseline unchangedNot verified
/motion-render:motion-renderrun with the real player is tracked in Migrate the CLI scripts to TypeScript #3.