-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-3445 Use Git submodules for spec tests #2007
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
Conversation
…-testpath GODRIVER-3445 Refactor how spec test paths are built and update test dirs.
…ctest-path GODRIVER-3445 Make spectest.Path work for any caller.
…workflow GODRIVER-3445 Update specifications submodule weekly with dependabot.
API Change ReportNo changes found! |
|
|
||
| // run a CRUD operation and verify errors and outcomes. | ||
| // the test description is needed to see determine if the test is an aggregate with $out | ||
| func runCrudOperation(mt *mtest.T, testDescription string, operation crudOperation, outcome crudOutcome) { |
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.
All additional code in retryable_writes_prose_test.go was copied from crud_spec_test.go, which was removed because it's redundant with the new CRUD unified spec tests.
2c40309 to
285ab76
Compare
| // TODO: create new directory for mongocrypt | ||
| const resourcesDir = "../../../../testdata/mongocrypt" |
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.
Is this TODO still relevant?
| case "maxconnecting": | ||
| require.Equal(t, value, float64(cs.MaxConnecting)) | ||
| default: | ||
| fmt.Println(key) |
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.
Remove println.
| fmt.Println(key) |
| // Test case for all connection string spec tests. | ||
| func TestAuthSpec(t *testing.T) { | ||
| for _, file := range spectest.FindJSONFilesInDir(t, authTestsDir) { | ||
| fmt.Println("file", file) |
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.
Remove println.
| fmt.Println("file", file) |
| } | ||
|
|
||
| func runConnectionStringTest(t *testing.T, test connectionStringTest) { | ||
| if test.SkipReason != "" { |
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.
Can we also remove the SkipReason field from the connectionStringTest struct? As far as I can tell, the connection-string test spec don't include that field.
| params: | ||
| working_dir: "src/go.mongodb.org/mongo-driver" | ||
| script: | | ||
| git submodule update --init |
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.
Optional: Consider using the init-submodule task instead.
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 solution doesn't work for windows for some reason 🤷
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.
That's weird. Oh well, 🤷
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! 👍
GODRIVER-3445
This PR suggested using git submodules to avoid manually syncing unified spec tests with the MongoDB specifications.
When using for the first time, users must initialize the submodule:
And then switching to branches that do not have the spec submodule: