-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRIVERS-1603 Test format updates for serverless testing (#964)
- Loading branch information
1 parent
ec32686
commit 3586db8
Showing
46 changed files
with
648 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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,150 @@ | ||
{ | ||
"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 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "aggregate with multiple batches works", | ||
"operations": [ | ||
{ | ||
"name": "aggregate", | ||
"arguments": { | ||
"pipeline": [ | ||
{ | ||
"$match": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
} | ||
], | ||
"batchSize": 1 | ||
}, | ||
"object": "collection0", | ||
"expectResult": [ | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
} | ||
] | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"aggregate": "coll0", | ||
"pipeline": [ | ||
{ | ||
"$match": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
} | ||
} | ||
], | ||
"cursor": { | ||
"batchSize": 1 | ||
} | ||
}, | ||
"commandName": "aggregate", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 1 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "aggregate-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 1 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "aggregate-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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,64 @@ | ||
description: "aggregate" | ||
|
||
schemaVersion: "1.0" | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
useMultipleMongoses: true # ensure cursors pin to a single server | ||
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 } | ||
|
||
tests: | ||
- description: "aggregate with multiple batches works" | ||
operations: | ||
- name: aggregate | ||
arguments: | ||
pipeline: [ { $match: { _id: { $gt: 1 } }} ] | ||
batchSize: 1 | ||
object: *collection0 | ||
expectResult: | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
- { _id: 4, x: 44 } | ||
expectEvents: | ||
- client: *client0 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
aggregate: *collection0Name | ||
pipeline: [ { $match: { _id: { $gt: 1 } }} ] | ||
cursor: { batchSize: 1 } | ||
commandName: aggregate | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$type: [ int, long ] } | ||
collection: *collection0Name | ||
batchSize: 1 | ||
commandName: getMore | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$type: [ int, long ] } | ||
collection: *collection0Name | ||
batchSize: 1 | ||
commandName: getMore | ||
databaseName: *database0Name | ||
|
This file contains 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,156 @@ | ||
{ | ||
"description": "find", | ||
"schemaVersion": "1.0", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": true, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "find-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 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "find with multiple batches works", | ||
"operations": [ | ||
{ | ||
"name": "find", | ||
"arguments": { | ||
"filter": { | ||
"_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 | ||
} | ||
] | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": { | ||
"_id": { | ||
"$gt": 1 | ||
} | ||
}, | ||
"batchSize": 2 | ||
}, | ||
"commandName": "find", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 2 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
}, | ||
"collection": "coll0", | ||
"batchSize": 2 | ||
}, | ||
"commandName": "getMore", | ||
"databaseName": "find-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.