Repository navigation
test(risk-filter): seed date-based tests away from midnight UTC - #742
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The |
MateoLostanlen
left a comment
There was a problem hiding this comment.
Hi @Majyles, thanks for the PR!
Clean fix. Anchoring the seeds at noon yesterday makes these tests independent of the hour, and the "drops the alert" cases now actually test the filter.
I checked it with the clock faked to 00:10 UTC: the old version fails, this one passes.
The pytest-client failure is the flaky test fixed in #740. I'll merge that one first, then re-run CI here and merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #742 +/- ##
=======================================
Coverage 95.33% 95.33%
=======================================
Files 61 61
Lines 3428 3428
=======================================
Hits 3268 3268
Misses 160 160
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MateoLostanlen
left a comment
There was a problem hiding this comment.
Hi @Majyles, thanks for the PR!
Clean and well-scoped fix. I reproduced it locally with the clock faked to 00:10 UTC: 6 failures on main, 30/30 with this branch.
Happy to merge, thanks!
Closes #738
Four tests in
test_risk_filter.pyquery endpoints that return a single UTC day (date(started_at) == from_date), but seeded their data 20 to 50 minutes before now and asked for today. Shortly after midnight UTC the seeds fell on the previous day.referencetime (default: now, so the other tests are unchanged).from_date.The other tests in the file target the
/unlabeled/latestendpoints, which use a sliding 24 h window and are not affected.Checked by faking the test clock to 00:10 UTC: 6 failures before the change, 30/30 passing after. Full suite passes.
Generated with Claude Code