Repository navigation
test(audio): cover the duration limit boundary - #378
Merged
ashrafee-dev merged 1 commit intoNov 16, 2026
Merged
ashrafee-dev merged 1 commit into
ashrafee-dev merged 1 commit into
Conversation
The suite only proved that over-limit audio is rejected. This pins both edges: audio exactly at MAX_AUDIO_SECONDS is transcribed, and one frame over is rejected before the model is called. Verified by mutating the comparison in app/services/transcription.py from > to >=: the exactly-at-the-limit test then fails, so the test does pin the boundary rather than passing vacuously. Closes ashrafee-dev#150
|
@noahkhomer18 is attempting to deploy a commit to the ashrafee-dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
Thanks for your contribution! @noahkhomer18 |
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.
Pins both edges of the audio duration limit.
Closes #150
What the suite proved before
test_duration_limit_precedes_model_inferenceusedMAX_AUDIO_SECONDS = 1and two seconds of decoded audio, so it only ever proved that over-limit audio is rejected. Nothing checked what happens at the limit itself.What this adds
Two tests against the same decoding harness:
test_audio_exactly_at_the_duration_limit_is_accepted— exactlyMAX_AUDIO_SECONDSof decoded audio is transcribed and the model is called once.test_audio_one_frame_over_the_duration_limit_is_rejected— one frame over raisesInvalidAudio("... exceeds ...")and the model is never called.Both use the existing
wavewriter pattern, so no fixtures, no real audio files and no ffmpeg.Verified
The new boundary test is not vacuous. Mutating the comparison in
app/services/transcription.pyfrom>to>=makes it fail:The source file is unchanged in this PR; only
tests/test_transcription.pymoves.