Repository navigation
test(evaluations): keep the review API cases inside the 90-day window - #322
Conversation
The review API fixtures used a hard-coded prediction_date of 2026-08-28 while the API only returns rows from the last 90 days, so the cases started failing on 2026-11-27 and broke the release workflow test gate. Use a date relative to today instead: the cases keep asserting the same window behaviour and no longer expire.
|
Continuing #316, which was closed on 2026-12-01 after its branch had been deleted — GitHub refuses to reopen a pull request whose head branch is gone, so the same fix is submitted again from a clean branch. What is in this pull request:
Why it matters right now: the review API only returns rows from the last 90 days, so the pinned fixture fell out of the window on 2026-11-27 and the three cases have failed on With this change the suite is green again: The cases still assert the same window behaviour — a record inside the window is returned, a record outside it is not — they just no longer expire with the calendar. The release workflow ( If a different approach is preferred for this (for example freezing the clock instead of deriving the date), please say so and I will rework it. |
Replaces #316, which was closed on 2026-12-01 after its branch had been deleted; the fix itself is unchanged and is now rebased onto the current
main.Background
The release workflow runs
python -m pytest tests/ -x -qbefore it builds the Docker image, and that gate started failing on 2026-11-27.tests/test_evaluations_api.pybuilt its fixture with a hard-codedprediction_date="2026-08-28", while the review API only returns rows inside a rolling window (prediction_date >= today - days,daysdefaults to 90). The fixture was inside that window on the day it was written and fell out of it on 2026-11-27, so three cases started failing and every release build stopped at the test step.Observed in the release run of this repository (
release/Run tests):The same three cases also fail the upstream
Application regression / backendjob on every pull request, including ones that do not touch this area:Changes
tests/test_evaluations_api.pyonly: the fixture date is now computed relative to today (date.today() - timedelta(days=10)) instead of being pinned to a calendar date. The legacy calendar-day record uses the same relative date, so it stays inside the window and is still excluded from the hit-rate summary byhorizon_unit, not by its date.No production code is touched.
Scope
One outcome: the review API test cases no longer expire, so the release test gate stays green.
Excluded: no change to the review API, its window semantics or any other test.
Validation
Tested commit:
6316168Commands and results:
Before the change the same file reported
3 failed, 1 passedbecause the hard-coded date fell out of the 90-day window, and the whole suite reported3 failed, 1505 passed.Acceptance evidence
Steps:
.venv/bin/python -m pytest -q tests/test_evaluations_api.py.faketime, and run the same command again.Expected:
Observed:
Evidence: the same file, and the release workflow run that exposed the failure (quoted in the Background section). The fixture date is derived from
date.today(), so the cases cannot expire again.Boundaries and risks
mainbranch have been failing on this test since 2026-11-27, independently of this pull request.Follow-up
None.