Fix: use correct pagination param in threshold filter tests#1204
Conversation
The API uses LimitOffsetPagination which accepts ?limit=N, not ?page_size=N. The page_size parameter was silently ignored, defaulting to PAGE_SIZE=10. When other test data was present in the DB, some test occurrences could fall off the first page, causing intermittent failures in test_no_project_id_returns_all and potentially other threshold tests. Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for antenna-ssec ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for antenna-preview canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated query parameter names in test URLs within Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates threshold filter API tests to use the correct pagination query parameter for the project’s DRF pagination setup (LimitOffsetPagination), preventing intermittent CI failures caused by default paging.
Changes:
- Replaced
page_size=1000withlimit=1000inTestProjectDefaultThresholdFilterURLs for occurrences and taxa endpoints. - Ensured the “no project_id returns all” test requests a sufficiently large page size via the correct param.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Fixes an intermittent CI test failure in
TestProjectDefaultThresholdFilter.test_no_project_id_returns_all.The API uses
LimitOffsetPagination(accepts?limit=N&offset=N), but the tests were using?page_size=1000which is the parameter forPageNumberPagination. Thepage_sizeparam was silently ignored, causing the API to use the defaultPAGE_SIZE=10. When other test data was present in the DB, some test occurrences could fall off the first page of 10 results, causing intermittent assertion failures like:Changed all three
page_size=1000occurrences tolimit=1000inTestProjectDefaultThresholdFilter.Test plan
Summary by CodeRabbit