-
Notifications
You must be signed in to change notification settings - Fork 244
DRIVERS-1603 Unified test format updates for serverless testing #944
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
Changes from all commits
36e48f9
a3e4698
b2c9194
900c28e
a39017a
cf13681
24275fd
de4a488
99f6351
18a3ac3
63c4ff2
2a76074
6341d0c
3e0b486
fa0be10
fc7fc7a
a0dfb5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"description": "aggregate", | ||
"schemaVersion": "1.0", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": true, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "aggregate-tests", | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"x": 11 | ||
}, | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
}, | ||
{ | ||
"_id": 5, | ||
"x": 55 | ||
}, | ||
{ | ||
"_id": 6, | ||
"x": 66 | ||
}, | ||
{ | ||
"_id": 7, | ||
"x": 77 | ||
}, | ||
{ | ||
"_id": 8, | ||
"x": 88 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "aggregate with multiple batches works", | ||
"operations": [ | ||
{ | ||
"name": "aggregate", | ||
"arguments": { | ||
"pipeline": [ | ||
{ | ||
"$match": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
} | ||
], | ||
"batchSize": 2 | ||
}, | ||
"object": "collection0", | ||
"expectResult": [ | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
}, | ||
{ | ||
"_id": 5, | ||
"x": 55 | ||
}, | ||
{ | ||
"_id": 6, | ||
"x": 66 | ||
}, | ||
{ | ||
"_id": 7, | ||
"x": 77 | ||
}, | ||
{ | ||
"_id": 8, | ||
"x": 88 | ||
} | ||
] | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"aggregate": "coll0", | ||
"pipeline": [ | ||
{ | ||
"$match": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
} | ||
], | ||
"cursor": { | ||
"batchSize": 2 | ||
} | ||
}, | ||
"commandName": "aggregate", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$exists": true | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 2 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$exists": true | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 2 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$exists": true | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 2 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "aggregate-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
description: "aggregate" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and |
||
|
||
schemaVersion: "1.0" | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
useMultipleMongoses: true # ensure cursors pin to a single server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good thinking! |
||
observeEvents: [ commandStartedEvent ] | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name aggregate-tests | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
documents: | ||
- { _id: 1, x: 11 } | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
- { _id: 4, x: 44 } | ||
- { _id: 5, x: 55 } | ||
- { _id: 6, x: 66 } | ||
- { _id: 7, x: 77 } | ||
- { _id: 8, x: 88 } | ||
|
||
tests: | ||
- description: "aggregate with multiple batches works" | ||
operations: | ||
- name: aggregate | ||
arguments: | ||
pipeline: [ { $match: { _id: { $gt: 1 } }} ] | ||
batchSize: 2 | ||
object: *collection0 | ||
expectResult: | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
- { _id: 4, x: 44 } | ||
- { _id: 5, x: 55 } | ||
- { _id: 6, x: 66 } | ||
- { _id: 7, x: 77 } | ||
- { _id: 8, x: 88 } | ||
expectEvents: | ||
- client: *client0 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
aggregate: *collection0Name | ||
pipeline: [ { $match: { _id: { $gt: 1 } }} ] | ||
cursor: { batchSize: 2 } | ||
commandName: aggregate | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$exists: true } | ||
collection: *collection0Name | ||
batchSize: 2 | ||
commandName: getMore | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$exists: true } | ||
collection: *collection0Name | ||
batchSize: 2 | ||
commandName: getMore | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$exists: true } | ||
collection: *collection0Name | ||
batchSize: 2 | ||
commandName: getMore | ||
databaseName: *database0Name | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
description: "estimatedDocumentCount" | ||
|
||
schemaVersion: "1.0" | ||
schemaVersion: "1.3" | ||
|
||
createEntities: | ||
- client: | ||
|
@@ -34,6 +34,7 @@ tests: | |
- description: "estimatedDocumentCount uses $collStats on 4.9.0 or greater" | ||
runOnRequirements: | ||
- minServerVersion: "4.9.0" | ||
serverless: forbid | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this forbidden? I think the new aggregation pipeline for estimatedDocumentCount would work against serverless. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed a little bit in slack, the proxy doesn't yet support count via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that intended to be addressed before public release? Either way, I think this warrants a comment (as you did for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
operations: | ||
- name: estimatedDocumentCount | ||
object: *collection0 | ||
|
@@ -53,6 +54,7 @@ tests: | |
- description: "estimatedDocumentCount with maxTimeMS on 4.9.0 or greater" | ||
runOnRequirements: | ||
- minServerVersion: "4.9.0" | ||
serverless: forbid | ||
operations: | ||
- name: estimatedDocumentCount | ||
object: *collection0 | ||
|
@@ -75,6 +77,7 @@ tests: | |
- description: "estimatedDocumentCount on non-existent collection on 4.9.0 or greater" | ||
runOnRequirements: | ||
- minServerVersion: "4.9.0" | ||
serverless: forbid | ||
operations: | ||
- name: estimatedDocumentCount | ||
object: *collection1 | ||
|
@@ -94,6 +97,7 @@ tests: | |
- description: "estimatedDocumentCount errors correctly on 4.9.0 or greater--command error" | ||
runOnRequirements: | ||
- minServerVersion: "4.9.0" | ||
serverless: forbid | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
|
@@ -124,6 +128,7 @@ tests: | |
- description: "estimatedDocumentCount errors correctly on 4.9.0 or greater--socket error" | ||
runOnRequirements: | ||
- minServerVersion: "4.9.0" | ||
serverless: forbid | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
|
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.
"Serverless" is still capitalized here.