Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-1530 GODRIVER-1213 Fix the enterprise auth test runner. #1118

Merged

Conversation

matthewdale
Copy link
Collaborator

@matthewdale matthewdale commented Nov 2, 2022

GODRIVER-1530, GODRIVER-1213

Summary

  • Refactor the enterprise auth test runner to use mongo.Connect instead of topology.New.
  • Load the MongoDB test URI from the MONGODB_URI environment variable and ensure the URI environment variable is always passed to the test runner.
  • Move the test runner to the cmd/ directory. Remove all outdated examples from the x/mongo/driver/examples directory.
  • Allow the SERVICE_HOST auth mechanism property to be specified in a connection string.

Background & Motivation

#1044 broke the enterprise auth tests, which are only run on the waterfall and went unnoticed until now. That PR broke the tests because it didn't pull the database name from the connection string, instead it used "test" for all tests. In any case, we shouldn't use the unstable topology.Topology APIs for the enterprise auth tests anyway because it's not representative of how most people use enterprise auth (most use the mongo.Client type via mongo.Connect).

Refactor the enterprise auth test runner to use mongo.Connect instead of topology.New, loading the MongoDB test URI from the MONGODB_URI environment variable and using the defaultauthdb database name from the connection string, and move the test runner to the cmd/ directory. Remove all outdated examples from the x/mongo/driver/examples directory.

@matthewdale matthewdale force-pushed the godriver1530-fix-enterprise-auth-tests branch from ebb2f94 to 1753789 Compare November 2, 2022 04:14
@matthewdale matthewdale marked this pull request as ready for review November 2, 2022 04:14
@matthewdale matthewdale force-pushed the godriver1530-fix-enterprise-auth-tests branch 2 times, most recently from c2b6a40 to 28e1fbc Compare November 2, 2022 04:37
@matthewdale matthewdale force-pushed the godriver1530-fix-enterprise-auth-tests branch from 28e1fbc to 08dbbb9 Compare November 2, 2022 04:38
Copy link
Contributor

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

Evergreen changes and the new testentauth/main.go LGTM.

Those examples definitely look outdated; I think I'm fine removing, as I don't see what to replace the examples with. But, can we also close GODRIVER-2527 and remove the x/mongo/driver/examples folder entirely?

cmd/testentauth/main.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@prestonvasquez prestonvasquez left a comment

Choose a reason for hiding this comment

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

LGTM

@matthewdale matthewdale force-pushed the godriver1530-fix-enterprise-auth-tests branch from 45dbdee to 42f0694 Compare November 2, 2022 19:44
@matthewdale matthewdale changed the title GODRIVER-1530 Fix the enterprise auth test runner. GODRIVER-1530 GODRIVER-1213 Fix the enterprise auth test runner. Nov 2, 2022
Copy link
Contributor

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

LGTM assuming tests pass, thank you.

cmd/testentauth/main.go Outdated Show resolved Hide resolved
Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
@matthewdale matthewdale merged commit 1123dac into mongodb:master Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants