-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3312 Convert SDAM integration tests to unified #1028
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
435ff01
PYTHON-3312 Convert SDAM integration tests to unified
ShaneHarvey 11850f9
PYTHON-3312 spec test fixes
ShaneHarvey 5fddf42
PYTHON-3312 Remove unused imports
ShaneHarvey 7dffeb2
PYTHON-3312 Fix mypy issues
ShaneHarvey 05db74d
PYTHON-3312 Make _ConnectionEvent the base class for ALL connection e…
ShaneHarvey 80f1b05
PYTHON-3312 Resync spec tests
ShaneHarvey c1288ee
Merge branch 'master' into PYTHON-3312
ShaneHarvey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
{ | ||
"description": "auth-error", | ||
"schemaVersion": "1.10", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "4.4", | ||
"auth": true, | ||
"serverless": "forbid", | ||
"topologies": [ | ||
"single", | ||
"replicaset", | ||
"sharded" | ||
] | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "setupClient", | ||
"useMultipleMongoses": false | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "auth-error", | ||
"databaseName": "sdam-tests", | ||
"documents": [ | ||
{ | ||
"_id": 1 | ||
}, | ||
{ | ||
"_id": 2 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "Reset server and pool after AuthenticationFailure error", | ||
"operations": [ | ||
{ | ||
"name": "failPoint", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "setupClient", | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"saslContinue" | ||
], | ||
"appName": "authErrorTest", | ||
"errorCode": 18 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "createEntities", | ||
"object": "testRunner", | ||
"arguments": { | ||
"entities": [ | ||
{ | ||
"client": { | ||
"id": "client", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent", | ||
"serverDescriptionChangedEvent", | ||
"poolClearedEvent" | ||
], | ||
"uriOptions": { | ||
"retryWrites": false, | ||
"appname": "authErrorTest" | ||
} | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database", | ||
"client": "client", | ||
"databaseName": "sdam-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection", | ||
"database": "database", | ||
"collectionName": "auth-error" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "insertMany", | ||
"object": "collection", | ||
"arguments": { | ||
"documents": [ | ||
{ | ||
"_id": 3 | ||
}, | ||
{ | ||
"_id": 4 | ||
} | ||
] | ||
}, | ||
"expectError": { | ||
"isError": true | ||
} | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client", | ||
"event": { | ||
"serverDescriptionChangedEvent": { | ||
"newDescription": { | ||
"type": "Unknown" | ||
} | ||
} | ||
}, | ||
"count": 1 | ||
} | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client", | ||
"event": { | ||
"poolClearedEvent": {} | ||
}, | ||
"count": 1 | ||
} | ||
}, | ||
{ | ||
"name": "insertMany", | ||
"object": "collection", | ||
"arguments": { | ||
"documents": [ | ||
{ | ||
"_id": 5 | ||
}, | ||
{ | ||
"_id": 6 | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "assertEventCount", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client", | ||
"event": { | ||
"serverDescriptionChangedEvent": { | ||
"newDescription": { | ||
"type": "Unknown" | ||
} | ||
} | ||
}, | ||
"count": 1 | ||
} | ||
}, | ||
{ | ||
"name": "assertEventCount", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client", | ||
"event": { | ||
"poolClearedEvent": {} | ||
}, | ||
"count": 1 | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client", | ||
"eventType": "command", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"insert": "auth-error", | ||
"documents": [ | ||
{ | ||
"_id": 5 | ||
}, | ||
{ | ||
"_id": 6 | ||
} | ||
] | ||
}, | ||
"commandName": "insert", | ||
"databaseName": "sdam-tests" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"outcome": [ | ||
{ | ||
"collectionName": "auth-error", | ||
"databaseName": "sdam-tests", | ||
"documents": [ | ||
{ | ||
"_id": 1 | ||
}, | ||
{ | ||
"_id": 2 | ||
}, | ||
{ | ||
"_id": 5 | ||
}, | ||
{ | ||
"_id": 6 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
I refactored the private base class hierarchy here to make _ConnectionEvent the base class for ALL connection events. This makes the CMAP event filtering events easier since we can do
isinstance(e, (_ConnectionEvent, _PoolEvent))