Skip to content

PYTHON-5786 Add test variant for the Secure Frontend Processor (monguard) - #2948

Merged
NoahStapp merged 3 commits into
mongodb:mainfrom
NoahStapp:PYTHON-5786
Jul 21, 2026
Merged

NoahStapp merged 3 commits into
mongodb:mainfrom
NoahStapp:PYTHON-5786

Conversation

@NoahStapp

@NoahStapp NoahStapp commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

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 there test coverage?
  • [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Comment thread .evergreen/scripts/setup_tests.py Dismissed
@NoahStapp
NoahStapp marked this pull request as ready for review July 21, 2026 15:30
@NoahStapp
NoahStapp requested a review from a team as a code owner July 21, 2026 15:30
@NoahStapp
NoahStapp requested review from blink1073 and Copilot July 21, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sfp test suite/variant, including secret handling and certificate materialization.
  • Registers the sfp pytest 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.

Comment thread test/test_sfp.py Resolved
Comment thread test/asynchronous/test_sfp.py Resolved
Comment thread test/test_sfp.py
username = _require_env("SFP_ATLAS_USER")
password = _require_env("SFP_ATLAS_PASSWORD")
for variation, kwargs in VARIATIONS.items():
with self.subTest(variation=variation):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires pytest 9.0+. We need to bump our min version in requirements and pytest.ini config

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually unittest.subTest, not the pytest version. Unittest support was added in Python 3.4.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In addition, unittest.TestCase.subTest() is now also supported."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explicitly looked this up because I knew this was a feature gap, I've run into it before

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With pytest < 9.0, subtests still run, but if one fails it stops there instead of running the others.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for verifying

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NoahStapp
NoahStapp merged commit 3eea205 into mongodb:main Jul 21, 2026
86 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants