Repository navigation
PYTHON-5786 Add test variant for the Secure Frontend Processor (monguard) - #2948
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Evergreen test variant and corresponding sync/async test suites to validate connectivity and authentication through an Atlas Secure Frontend Processor (SFP / “monguard”) in line with the SFP testing spec.
Changes:
- Adds new
sfp-marked integration tests (sync + async) covering unauthenticated access, SCRAM-SHA-256, and x509, with configuration variations (baseline, compression, Server API v1). - Wires up a new Evergreen
sfptest suite/variant, including secret handling and certificate materialization. - Registers the
sfppytest marker and ignores the generated x509 cert file in git.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/test_sfp.py |
Adds synchronous SFP connectivity/auth/CRUD tests with pytest.mark.sfp. |
test/asynchronous/test_sfp.py |
Adds asynchronous SFP connectivity/auth/CRUD tests with pytest.mark.sfp. |
pyproject.toml |
Registers the sfp pytest marker. |
.gitignore |
Ignores the generated SFP x509 client certificate PEM file. |
.evergreen/scripts/utils.py |
Adds sfp to Evergreen test-suite mappings and orchestration exclusions. |
.evergreen/scripts/setup_tests.py |
Adds SFP secret loading and writes the x509 cert PEM for tests. |
.evergreen/scripts/generate_config.py |
Adds a generator function for the SFP build variant. |
.evergreen/generated_configs/variants.yml |
Adds the generated sfp-rhel8 build variant definition. |
| username = _require_env("SFP_ATLAS_USER") | ||
| password = _require_env("SFP_ATLAS_PASSWORD") | ||
| for variation, kwargs in VARIATIONS.items(): | ||
| with self.subTest(variation=variation): |
There was a problem hiding this comment.
This requires pytest 9.0+. We need to bump our min version in requirements and pytest.ini config
There was a problem hiding this comment.
This is actually unittest.subTest, not the pytest version. Unittest support was added in Python 3.4.
There was a problem hiding this comment.
"In addition, unittest.TestCase.subTest() is now also supported."
There was a problem hiding this comment.
I explicitly looked this up because I knew this was a feature gap, I've run into it before
There was a problem hiding this comment.
With pytest < 9.0, subtests still run, but if one fails it stops there instead of running the others.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PYTHON-5786
Changes in this PR
Adds a SFP (monguard) test variant in accordance with the SFP testing spec.
Test Plan
Adds the tests described by the SFP testing spec.
Evergreen patch.
Checklist
Checklist for Author
[ ] Did you update the changelog (if necessary)?[ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).Checklist for Reviewer