Improve test-local phase reporting and stabilize MongoDB CI#389
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #389 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 16 16
Lines 2109 2109
Branches 251 251
=======================================
Hits 2108 2108
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
e0fc558 to
a7a9127
Compare
There was a problem hiding this comment.
Pull request overview
Improves local test script phase reporting/exit-code aggregation and stabilizes MongoDB CI by avoiding Dockerized MongoDB on GitHub-hosted Windows runners while keeping live MongoDB coverage on Linux. Also updates the Mongo test helper to opt into Python’s safe tar extraction behavior for the in-memory Mongo path under stricter warning settings.
Changes:
- Refactors
scripts/test-local.shto capture and report separate exit codes/statuses for the main pytest phase and optional serial-local phase, then aggregates a final exit code. - Updates GitHub Actions MongoDB matrix behavior to skip Dockerized MongoDB startup on Windows and select in-memory Mongo there, while keeping Dockerized Mongo on Linux.
- Adds a tarfile extraction filter configuration hook before instantiating
pymongo_inmemory’s Mongo client, and updates README wording to match the new CI behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/mongo_tests/helpers.py |
Configures tarfile extraction filter before creating an in-memory MongoDB client. |
scripts/test-local.sh |
Adds a helper for phase execution/reporting and explicitly aggregates per-phase exit codes. |
README.rst |
Updates documentation to reflect Linux live-Mongo vs Windows in-memory CI behavior. |
.github/workflows/ci-test.yml |
Skips Dockerized Mongo on Windows and sets CACHIER_TEST_VS_DOCKERIZED_MONGO per Mongo test step. |
Closes #362.
Summary
pymongo_inmemorypath for Windows MongoDB matrix jobs.pymongo_inmemorytarfile deprecation warning filter to in-memory Mongo client startup, preserving the repo's-W errorposture without mutating global tarfile behavior.Validation
bash -n scripts/test-local.shpytestto verify main phase failure exits non-zero, still runs serial local tests, and reports the main phase failure.pytestto verify serial local failure exits non-zero and reports the serial phase failure.pytestto verify both phases passing exits zero../scripts/test-local.sh pickleCACHIER_TEST_VS_DOCKERIZED_MONGO=false pytest -m mongo --cov=cachier --cov-report=term.github/workflows/ci-test.ymlwith PyYAML.ruff check tests/mongo_tests/helpers.pygit diff --checkCI scope note
The PR now intentionally changes CI behavior: Windows MongoDB matrix jobs no longer attempt to start a Linux MongoDB container through Docker. Non-Windows MongoDB matrix jobs still run against a live Dockerized MongoDB service and remain the live-Mongo compatibility signal. Windows MongoDB matrix jobs remain useful compatibility coverage over the Mongo backend API using
pymongo_inmemory.Milestone
No open repository milestones are currently available, so none was assigned.