chore(NODE-7826): test connect() which includes auth, purely - #5046
Conversation
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
🟢 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
thrownsentinel and lettingclient.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 usestry/finallyaroundconnect()/close()(e.g.,test/manual/socks5.test.ts:304-310).
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
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
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript