-
Notifications
You must be signed in to change notification settings - Fork 912
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
GODRIVER-1686 Add tests against Atlas Data Lake #462
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
849608d
to
9c0cd40
Compare
RunOn(testFile.RunOn...). | ||
CreateClient(false) | ||
if specDir == "atlas-data-lake-testing" { | ||
mtOpts.AtlasDataLake(true) |
There was a problem hiding this comment.
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?
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
No description provided.