-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
14f40c8
commit 426d698
Showing
25 changed files
with
547 additions
and
37 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
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
74 changes: 74 additions & 0 deletions
74
test/spec/unified-test-format/valid-pass/createEntities-operation.json
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,74 @@ | ||
{ | ||
"description": "createEntities-operation", | ||
"schemaVersion": "1.9", | ||
"tests": [ | ||
{ | ||
"description": "createEntities operation", | ||
"operations": [ | ||
{ | ||
"name": "createEntities", | ||
"object": "testRunner", | ||
"arguments": { | ||
"entities": [ | ||
{ | ||
"client": { | ||
"id": "client1", | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database1", | ||
"client": "client1", | ||
"databaseName": "database1" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection1", | ||
"database": "database1", | ||
"collectionName": "coll1" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "deleteOne", | ||
"object": "collection1", | ||
"arguments": { | ||
"filter": { | ||
"_id": 1 | ||
} | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client1", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"delete": "coll1", | ||
"deletes": [ | ||
{ | ||
"q": { | ||
"_id": 1 | ||
}, | ||
"limit": 1 | ||
} | ||
] | ||
}, | ||
"commandName": "delete", | ||
"databaseName": "database1" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
38 changes: 38 additions & 0 deletions
38
test/spec/unified-test-format/valid-pass/createEntities-operation.yml
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,38 @@ | ||
description: createEntities-operation | ||
|
||
# Note: createEntities is not technically in the 1.9 schema but was introduced at the same time. | ||
schemaVersion: "1.9" | ||
|
||
tests: | ||
- description: createEntities operation | ||
operations: | ||
- name: createEntities | ||
object: testRunner | ||
arguments: | ||
entities: | ||
- client: | ||
id: &client1 client1 | ||
observeEvents: [ commandStartedEvent ] | ||
- database: | ||
id: &database1 database1 | ||
client: *client1 | ||
databaseName: &database1Name database1 | ||
- collection: | ||
id: &collection1 collection1 | ||
database: *database1 | ||
collectionName: &collection1Name coll1 | ||
- name: deleteOne | ||
object: *collection1 | ||
arguments: | ||
filter: { _id : 1 } | ||
expectEvents: | ||
- client: *client1 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
delete: *collection1Name | ||
deletes: | ||
- q: { _id: 1 } | ||
limit: 1 | ||
commandName: delete | ||
databaseName: *database1Name |
111 changes: 111 additions & 0 deletions
111
test/spec/unified-test-format/valid-pass/entity-cursor-iterateOnce.json
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,111 @@ | ||
{ | ||
"description": "entity-cursor-iterateOnce", | ||
"schemaVersion": "1.9", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"databaseName": "database0", | ||
"collectionName": "coll0", | ||
"documents": [ | ||
{ | ||
"_id": 1 | ||
}, | ||
{ | ||
"_id": 2 | ||
}, | ||
{ | ||
"_id": 3 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "iterateOnce", | ||
"operations": [ | ||
{ | ||
"name": "createFindCursor", | ||
"object": "collection0", | ||
"arguments": { | ||
"filter": {}, | ||
"batchSize": 2 | ||
}, | ||
"saveResultAsEntity": "cursor0" | ||
}, | ||
{ | ||
"name": "iterateUntilDocumentOrError", | ||
"object": "cursor0", | ||
"expectResult": { | ||
"_id": 1 | ||
} | ||
}, | ||
{ | ||
"name": "iterateUntilDocumentOrError", | ||
"object": "cursor0", | ||
"expectResult": { | ||
"_id": 2 | ||
} | ||
}, | ||
{ | ||
"name": "iterateOnce", | ||
"object": "cursor0" | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": {}, | ||
"batchSize": 2 | ||
}, | ||
"commandName": "find", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"getMore": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
}, | ||
"collection": "coll0" | ||
}, | ||
"commandName": "getMore" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
59 changes: 59 additions & 0 deletions
59
test/spec/unified-test-format/valid-pass/entity-cursor-iterateOnce.yml
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,59 @@ | ||
description: entity-cursor-iterateOnce | ||
|
||
# Note: iterateOnce is not technically in the 1.9 schema but was introduced at the same time. | ||
schemaVersion: "1.9" | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
observeEvents: [ commandStartedEvent ] | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name database0 | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
|
||
initialData: | ||
- databaseName: *database0Name | ||
collectionName: *collection0Name | ||
documents: | ||
- _id: 1 | ||
- _id: 2 | ||
- _id: 3 | ||
|
||
tests: | ||
- description: iterateOnce | ||
operations: | ||
- name: createFindCursor | ||
object: *collection0 | ||
arguments: | ||
filter: {} | ||
batchSize: 2 | ||
saveResultAsEntity: &cursor0 cursor0 | ||
- name: iterateUntilDocumentOrError | ||
object: *cursor0 | ||
expectResult: { _id: 1 } | ||
- name: iterateUntilDocumentOrError | ||
object: *cursor0 | ||
expectResult: { _id: 2 } | ||
# This operation could be iterateUntilDocumentOrError, but we use iterateOne to ensure that drivers support it. | ||
- name: iterateOnce | ||
object: *cursor0 | ||
expectEvents: | ||
- client: *client0 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
find: *collection0Name | ||
filter: {} | ||
batchSize: 2 | ||
commandName: find | ||
databaseName: *database0Name | ||
- commandStartedEvent: | ||
command: | ||
getMore: { $$type: [ int, long ] } | ||
collection: *collection0Name | ||
commandName: getMore |
Oops, something went wrong.