Skip to content

chore(NODE-7826): test connect() which includes auth, purely - #5046

Merged
PavelSafronov merged 2 commits into
mainfrom
NODE-7826/fix-ldap-auth-tests
Sep 3, 2026
Merged

chore(NODE-7826): test connect() which includes auth, purely#5046
PavelSafronov merged 2 commits into
mainfrom
NODE-7826/fix-ldap-auth-tests

Conversation

@johnmtll

@johnmtll johnmtll commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Summary of Changes

There is no data in the shared enterprise auth DB used in evergreen tests. This data is checked in our LDAP auth tests, but checking auth does not necessitate data checks, so we should remove this anyway.

Reverts: 2b3fc6f which fixes the CI.

Notes for Reviewers

What is the motivation for this change?

Release Highlight

Release notes highlight

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@johnmtll
johnmtll requested a review from a team as a code owner September 2, 2026 20:19
Copilot AI lite review requested due to automatic review settings September 2, 2026 20:19

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.

🟡 Changes recommended

The updated test introduces a TypeScript error by using an uninitialized let thrown: Error that is only assigned in the catch branch.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the manual LDAP authentication test to validate that MongoClient.connect() succeeds (implicitly covering auth) without performing a follow-up CRUD operation, as part of reverting prior changes that were impacting CI.

Changes:

  • Simplifies the LDAP manual test to only assert that connect() completes without error.
  • Removes the post-connect findOne() assertion previously used to validate LDAP behavior.
File summaries
File Description
test/manual/ldap.test.ts Adjusts the LDAP manual test to only exercise connect() (auth) and avoid additional operations.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/manual/ldap.test.ts Outdated

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.

🟢 Approval recommended

The change is low-risk and limited to a manual test, removing brittle data assumptions without impacting driver runtime behavior.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

test/manual/ldap.test.ts:22

  • This test can be simplified and made more consistent with other tests by avoiding the thrown sentinel and letting client.connect() throw naturally, while still guaranteeing cleanup. The current try/catch converts a connection failure into an assertion failure and adds extra state, whereas the codebase commonly uses try/finally around connect()/close() (e.g., test/manual/socks5.test.ts:304-310).
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@PavelSafronov PavelSafronov self-assigned this Sep 3, 2026
@PavelSafronov PavelSafronov added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Sep 3, 2026
@PavelSafronov
PavelSafronov merged commit 3cfed47 into main Sep 3, 2026
31 of 34 checks passed
@PavelSafronov
PavelSafronov deleted the NODE-7826/fix-ldap-auth-tests branch September 3, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants