PYTHON-6071 Fix ML-KEM OCSP tests and run min-deps OCSP task on PRs - #3037
Conversation
6466dd8 to
136cc31
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped to tests and CI configuration, and the updated mocking approach and task tagging align with the intended OCSP behavior without introducing functional driver risk.
Pull request overview
This PR fixes OCSP signature-verification tests that were failing under the min-deps CI environment due to cryptography’s OpenSSL build lacking ML-KEM support, and updates Evergreen config generation so PR CI runs a minimal, targeted set of stapled-OCSP tasks (including min-deps) to catch backend regressions before merge.
Changes:
- Updated ML-KEM “fails closed” OCSP unit tests to use
MagicMock(spec=MLKEM*PublicKey)instead of generating real ML-KEM keys. - Added a PR-only Evergreen build variant that runs stapled OCSP tasks selected by the
.prtag. - Adjusted OCSP task tagging so PR CI runs exactly two stapled OCSP tasks (ECDSA only): one min-deps (4.4) and one latest-CPython (latest, with coverage).
File summaries
| File | Description |
|---|---|
test/test_ocsp_support.py |
Reworks ML-KEM OCSP signature tests to avoid relying on runtime ML-KEM support in the local cryptography/OpenSSL build. |
.evergreen/scripts/generate_config.py |
Generates a PR-only “OCSP Staples” variant and tags only the intended ECDSA stapled OCSP tasks for PR execution (min-deps + latest). |
.evergreen/generated_configs/variants.yml |
Adds the generated PR build variant for stapled OCSP tasks on the default host. |
.evergreen/generated_configs/tasks.yml |
Reflects the new PR tagging behavior (adds PR tag for the selected ECDSA tasks; removes PR tagging/coverage from RSA stapled task). |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are consistent with the PR description, appear internally coherent (tests + config generation + generated outputs), and reduce CI fragility without altering runtime driver behavior.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
Assigned |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PYTHON-6071
Changes in this PR
MagicMock(spec=...), so they no longer depend oncryptography's backend supporting ML-KEM.ecdsa) to keep PR CI at two tasks instead of four.Test Plan
pytest test/test_ocsp_support.py::TestVerifySignature -m ocsp: 9 passed, including under a min-deps (cryptography==47.0.0) environment where they previously failed withUnsupportedAlgorithm.just lintandjust typing: clean.Checklist
Checklist for Author
Checklist for Reviewer