-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-1872 Add sessions spec tests to verify explicit sessions were created on the correct client #1754
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
Open
qingyang-hu
wants to merge
3
commits into
mongodb:master
Choose a base branch
from
qingyang-hu:drivers1872
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+705
−7
Open
DRIVERS-1872 Add sessions spec tests to verify explicit sessions were created on the correct client #1754
Changes from all commits
Commits
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
450 changes: 450 additions & 0 deletions
450
source/sessions/tests/driver-sessions-argument-for-correct-client.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
253 changes: 253 additions & 0 deletions
253
source/sessions/tests/driver-sessions-argument-for-correct-client.yml
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,253 @@ | ||
description: driver-sessions-argument-for-correct-client | ||
|
||
schemaVersion: "1.0" | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
- client: | ||
id: &client1 client1 | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name session-tests | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name test | ||
- session: | ||
id: &session1 session1 | ||
client: *client1 | ||
|
||
tests: | ||
- description: Session argument is for the right client | ||
operations: | ||
- name: insertOne | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
document: { _id: 2 } | ||
expectError: | ||
isClientError: true | ||
- name: insertMany | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
documents: [ { _id: 1 } ] | ||
expectError: | ||
isClientError: true | ||
- name: deleteOne | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
expectError: | ||
isClientError: true | ||
- name: deleteMany | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
expectError: | ||
isClientError: true | ||
- name: updateOne | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
update: { $set: { x: 2 } } | ||
expectError: | ||
isClientError: true | ||
- name: updateMany | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
update: { $set: { x: 2 } } | ||
expectError: | ||
isClientError: true | ||
- name: updateSearchIndex | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
name: test index | ||
definition: {} | ||
expectError: | ||
isClientError: true | ||
- name: replaceOne | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
replacement: { x: 2 } | ||
expectError: | ||
isClientError: true | ||
- name: aggregate | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
pipeline: [] | ||
expectError: | ||
isClientError: true | ||
- name: bulkWrite | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
requests: [] | ||
expectError: | ||
isClientError: true | ||
- name: estimatedDocumentCount | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: distinct | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
fieldName: x | ||
filter: {} | ||
expectError: | ||
isClientError: true | ||
- name: find | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { _id: 1 } | ||
expectError: | ||
isClientError: true | ||
- name: findOne | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { _id: 1 } | ||
expectError: | ||
isClientError: true | ||
- name: findOneAndDelete | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
expectError: | ||
isClientError: true | ||
- name: findOneAndReplace | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
replacement: { x: 2 } | ||
expectError: | ||
isClientError: true | ||
- name: findOneAndUpdate | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: { x: 3 } | ||
update: { $set: { x: 2 } } | ||
expectError: | ||
isClientError: true | ||
- name: countDocuments | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: {} | ||
expectError: | ||
isClientError: true | ||
- name: createFindCursor | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
filter: {} | ||
expectError: | ||
isClientError: true | ||
- name: createIndex | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
name: foo | ||
keys: { x: 1 } | ||
expectError: | ||
isClientError: true | ||
- name: createSearchIndex | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
model: {} | ||
expectError: | ||
isClientError: true | ||
- name: createSearchIndexes | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
models: [] | ||
expectError: | ||
isClientError: true | ||
- name: dropIndex | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
name: x_1 | ||
expectError: | ||
isClientError: true | ||
- name: dropIndexes | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: dropSearchIndex | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
name: x_1 | ||
expectError: | ||
isClientError: true | ||
- name: listIndexes | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: listSearchIndexes | ||
object: *collection0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: listCollections | ||
object: *database0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: listCollectionNames | ||
object: *database0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: dropCollection | ||
object: *database0 | ||
arguments: | ||
collection: collection0 | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- name: listDatabases | ||
object: *client0 | ||
arguments: | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
- description: Session argument is for the right client (clientBulkWrite) | ||
runOnRequirements: | ||
- minServerVersion: "8.0" | ||
operations: | ||
- name: clientBulkWrite | ||
object: *client0 | ||
arguments: | ||
models: [] | ||
session: *session1 | ||
expectError: | ||
isClientError: true | ||
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.
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.
Where from we get the list of operations? Should we also test the following commands (I've reviewed C# Driver public API that accepts session as a parameter)?