-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Various changes required to update unified change stream tests #912
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
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.
LGTM
driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java
Outdated
Show resolved
Hide resolved
Also, ensure that MongoQueryException pushes the property down through the constructor JAVA-4565
* Allows applications using an older driver to access a newer operation type, for which there is no enumerated value in OperationType * Allows operationType to be round-tripped with no information loss JAVA-4470
* Represent all cursors the same in Entities * Handle any MongoServerException in ErrorMatcher * Support "rename" operation * Special case some change stream tests that can't pass using ChangeStreamDocument JAVA-4470 JAVA-4555
Now that PRs are executing a larger set of variants, I'm seeing many of them fail. I will investigate and update the PR when I understand the root cause(s). |
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.
Despite the force pushes, GitHub showed me that the only file I need to review / re-review is SyncMongoCollection.java
, and that's what I did.
Tests are still failing, so this can't be merged yet. |
Tests are finally green, due to two changes:
|
driver-core/src/test/resources/unified-test-format/change-streams/change-streams.json
Show resolved
Hide resolved
Merged on command line. |
I'm doing all these as one PR because the unified change stream tests are what required the first two changes, but it was difficult to split up do to the overlapping commits to the unified tests. So submitting this as together but will not squash the commits.
JAVA-4565: this one was necessary because one of the new tests ends up throwing a MongoQueryException instead of a MongoCommandException, and MongoQueryException didn't have the errorCodeName property needed to make assertion.
JAVA-4470: this one is not fully done. It requires a bunch of things if we want to use ChangeStreamDocument for all the unified tests. The one that's now handled properly is an operationType for which there is no associated enum value. But for a couple of the new tests we're escaping to BsonDocument for the entire change stream document so that the assertions pass.
JAVA-4555: ChangeStreamDocument already handles the "to" field, so nothing needed to be done there. So it's just updates to the unified tests.