Skip to content

GODRIVER-1686 Add tests against Atlas Data Lake #462

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

Merged

Conversation

divjotarora
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@divjotarora divjotarora left a comment

Choose a reason for hiding this comment

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

Besides adding the prose tests and some other minor changes, the main difference is that we don't explicitly create or drop collections when testing against ADL because the mongohoused server is started with some seed data rather than the driver inserting the seed data at the beginning of each test. I added the ATLAS_DATA_LAKE_INTEGRATION_TEST environment variable to account for this.

@@ -1622,21 +1626,24 @@ func verifyListDatabasesResult(mt *mtest.T, actualResult mongo.ListDatabasesResu
func verifyCursorResult(mt *mtest.T, cur *mongo.Cursor, result interface{}) {
mt.Helper()

// The Atlas Data Lake tests expect a getMore to be sent even though the operation does not have a Result field.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was made to account for this spec test. The operation has no result field, so we were returning early because of the result == nil check but the expectations array assert that a getMore was sent, which can't happen unless we fully iterate the cursor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack

@divjotarora divjotarora force-pushed the godriver1686-data-lake-testing branch from 849608d to 9c0cd40 Compare July 21, 2020 18:14
RunOn(testFile.RunOn...).
CreateClient(false)
if specDir == "atlas-data-lake-testing" {
mtOpts.AtlasDataLake(true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Matching on the directory name kinda sucks, but these tests fail if run against a non-ADL server because the seed data isn't present. We might be able to do this by putting the top-level test function in a separate file like data_lake_spec_test.go, not modifying the directories slice in this file to include the atlas-data-lake-testing directory, and having the other file call this function directly. We do something similar for client-side encryption spec tests because they are only run if the cse build tag is enabled.

Does anyone have a preference?

Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Looks good. I think there's one missing assertion in the prose test.

@@ -1622,21 +1626,24 @@ func verifyListDatabasesResult(mt *mtest.T, actualResult mongo.ListDatabasesResu
func verifyCursorResult(mt *mtest.T, cur *mongo.Cursor, result interface{}) {
mt.Helper()

// The Atlas Data Lake tests expect a getMore to be sent even though the operation does not have a Result field.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ack

@divjotarora divjotarora merged commit 46d5d76 into mongodb:master Jul 24, 2020
@divjotarora divjotarora deleted the godriver1686-data-lake-testing branch July 24, 2020 17:58
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.

3 participants