Seed the e2e fixture where the API actually looks - #373
Merged
Conversation
…for them
seed.py wrote both peaks.json and beats.json into the job root. The pipeline
writes them under stems/ and that is the only place the endpoints look, so
both 404'd:
- GET /api/jobs/{id}/beats -> 404, the studio reported "No beat grid for this
track", and every click-track control stayed disabled. The click track, the
count-in and the grid editor could not be tested in a browser at all -- while
seed.py, at a glance, looked like it covered them.
- GET /api/jobs/{id}/stems/peaks.json -> 404, so the studio fell back to
decoding every stem for its waveforms. The precomputed-peaks path that every
real track takes was never exercised.
The grid also carries the shape beatgrid.py emits rather than an invented one,
`bars` included: without bar marks the accent mode degrades to "Auto (none
found)" and the detected-meter path never runs.
Adds tests/e2e/click-track.spec.mjs over what this unlocks -- the grid reaching
the studio, the click toggling, count-in persisting across a reload, the rate
control reporting the tempo it is actually clicking, the accent choice, and the
grid editor opening and closing from all three of its controls.
waitForClickTrack is a helper rather than part of openStudio: the metronome is
built after the transport reports a duration, and acting before then hits a
null metronome where the rate and accent controls silently no-op. That is what
made the rate test fail first time round, and it is worth naming.
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.
The bug
tests/e2e/seed.pywrote bothpeaks.jsonandbeats.jsoninto the job root.The pipeline writes them under
stems/, and that is the only place theendpoints look — so both 404'd for the whole life of the browser suite:
beats.json<job>/beats.json<job>/stems/beats.jsonpeaks.json<job>/peaks.json<job>/stems/peaks.jsonSo the click track, the count-in and the grid editor could not be covered in a
browser at all — while
seed.py, at a glance, looked like it covered them.And the precomputed-peaks path that every real track takes was never exercised;
the fixture silently tested the full-decode fallback instead.
The grid now also carries the shape
beatgrid.pyemits rather than an inventedone,
barsincluded — without bar marks the accent mode degrades to "Auto(none found)" and the detected-meter path never runs.
What it unlocks
tests/e2e/click-track.spec.mjs, covering what was previously untestable:/2→ 60 BPM,x2→ 240 BPM)which only works because
barsis now presentA note on the helper
waitForClickTrackis separate fromopenStudiodeliberately.openStudioreturns once the transport reports a duration, but the metronome is built later
— after the audio engine is up and the grid has been fetched. Acting before
then hits a null metronome, where the rate and accent controls silently
no-op: the click looks present and does nothing. That is what made the rate
test fail on the first run, and it seemed worth naming rather than papering
over with a sleep.
Verification
25/25 e2e pass (19 existing + 6 new). Confirmed by request log that
stems/peaks.jsonandbeatsnow return 200 where they previously 404'd, andthat the "no peaks.json; using full-decode engine" warning is gone.