Fix test suite stability and extended test configuration - #308
Conversation
- Refactor `backend/tests/agent/test_rate_limiter.py` to use `unittest.mock` for `datetime`, ensuring deterministic behavior at daily boundaries. - Update `backend/tests/conftest.py` to implement `pytest_addoption` and `pytest_collection_modifyitems` for the `--only-extended` flag. - Add `pytestmark = pytest.mark.extended` to `backend/tests/test_utils_hypothesis.py` to correctly exclude these property-based tests from standard runs. - Verify full test suite (backend standard, extended, and frontend) passes. Co-authored-by: MasumRab <8943353+MasumRab@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
WalkthroughThis PR introduces a testing infrastructure enhancement that allows for extended test filtering via a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
|
Closing as redundant; test suite stability and extended config already fixed in PR #326. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
- Refactor `backend/tests/agent/test_rate_limiter.py` to use `unittest.mock` for `datetime`, ensuring deterministic behavior at daily boundaries. - Update `backend/tests/conftest.py` to implement `pytest_addoption` and `pytest_collection_modifyitems` for the `--only-extended` flag. - Add `pytestmark = pytest.mark.extended` to `backend/tests/test_utils_hypothesis.py` to correctly exclude these property-based tests from standard runs. - Verify full test suite (backend standard, extended, and frontend) passes. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
@jules Conflicts detected. Please rebase branch on main using: |
This PR addresses test stability and configuration issues in the backend test suite.
RateLimiterFlakiness: Thetest_rate_limiter.pytests were relying on the system clock (datetime.now()), which could lead to failures if tests ran across midnight Pacific Time. This was fixed by usingunittest.mock.patchto freeze time during tests.make extended_tests: TheMakefiletargetextended_testsused the--only-extendedflag, which was not recognized bypytest. I added the necessary hooks inbackend/tests/conftest.pyto register this option and correctly filter tests marked with@pytest.mark.extended.backend/tests/test_utils_hypothesis.pycontains property-based tests that should be part of the extended suite but were missing the marker. I added the marker to ensure they are excluded from the standard test run and included in the extended run.These changes ensure that
make testandmake extended_testswork as intended and that the test suite is deterministic.PR created automatically by Jules for task 3968941239566233894 started by @MasumRab
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.