-
Notifications
You must be signed in to change notification settings - Fork 906
GODRIVER-2384 Unified test runner changes for CSOT. #912
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 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d0b63e8
Sync valid-pass UTF spec tests
4487845
Add support for collectionOptions
8c44f68
Add support for iterateOnce
80069c6
Add support for special lte matching operator
a63aa99
Add support for createEntities operation
7f09c09
Limit maxSize test to 3.6+
884f390
Reduce lte code complexity
f114f42
Kevin comments
e539862
Assert values are Int32 or Int64 for lte
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
108 changes: 108 additions & 0 deletions
108
data/unified-test-format/valid-pass/entity-cursor-iterateOnce.json
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,108 @@ | ||
{ | ||
"description": "entity-cursor-iterateOnce", | ||
"schemaVersion": "1.5", | ||
"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": "long" | ||
}, | ||
"collection": "coll0" | ||
}, | ||
"commandName": "getMore" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
58 changes: 58 additions & 0 deletions
58
data/unified-test-format/valid-pass/entity-cursor-iterateOnce.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,58 @@ | ||
description: entity-cursor-iterateOnce | ||
|
||
schemaVersion: '1.5' | ||
|
||
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: long } | ||
collection: *collection0Name | ||
commandName: getMore |
68 changes: 68 additions & 0 deletions
68
data/unified-test-format/valid-pass/initialCollectionData-collectionOptions.json
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,68 @@ | ||
{ | ||
"description": "initialCollectionData-collectionOptions", | ||
"schemaVersion": "1.5", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0" | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "database0", | ||
"collectionOptions": { | ||
"capped": true, | ||
"size": 512 | ||
}, | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"x": 11 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "collection is created with the correct options", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "3.6" | ||
} | ||
], | ||
"operations": [ | ||
{ | ||
"name": "runCommand", | ||
"object": "database0", | ||
"arguments": { | ||
"commandName": "collStats", | ||
"command": { | ||
"collStats": "coll0", | ||
"scale": 1 | ||
} | ||
}, | ||
"expectResult": { | ||
"capped": true, | ||
"maxSize": 512 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
41 changes: 41 additions & 0 deletions
41
data/unified-test-format/valid-pass/initialCollectionData-collectionOptions.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,41 @@ | ||
description: initialCollectionData-collectionOptions | ||
|
||
schemaVersion: '1.5' | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name database0 | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
collectionOptions: | ||
capped: true | ||
size: &cappedSize 512 | ||
documents: | ||
- { _id: 1, x: 11 } | ||
|
||
tests: | ||
- description: collection is created with the correct options | ||
runOnRequirements: | ||
- minServerVersion: "3.6" | ||
operations: | ||
# Execute a collStats command to ensure the collection was created with the correct options. | ||
- name: runCommand | ||
object: *database0 | ||
arguments: | ||
commandName: collStats | ||
command: | ||
collStats: *collection0Name | ||
scale: 1 | ||
expectResult: | ||
capped: true | ||
maxSize: *cappedSize | ||
78 changes: 78 additions & 0 deletions
78
data/unified-test-format/valid-pass/matches-lte-operator.json
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,78 @@ | ||
{ | ||
"description": "matches-lte-operator", | ||
"schemaVersion": "1.5", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0Name" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "database0Name", | ||
"documents": [] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "special lte matching operator", | ||
"operations": [ | ||
{ | ||
"name": "insertOne", | ||
"object": "collection0", | ||
"arguments": { | ||
"document": { | ||
"_id": 1, | ||
"y": 1 | ||
} | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"insert": "coll0", | ||
"documents": [ | ||
{ | ||
"_id": { | ||
"$$lte": 1 | ||
}, | ||
"y": { | ||
"$$lte": 2 | ||
} | ||
} | ||
] | ||
}, | ||
"commandName": "insert", | ||
"databaseName": "database0Name" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
data/unified-test-format/valid-pass/matches-lte-operator.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,40 @@ | ||
description: matches-lte-operator | ||
|
||
schemaVersion: '1.5' | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
observeEvents: [ commandStartedEvent ] | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name database0Name | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
documents: [] | ||
|
||
tests: | ||
- description: special lte matching operator | ||
operations: | ||
- name: insertOne | ||
object: *collection0 | ||
arguments: | ||
document: { _id : 1, y: 1 } | ||
expectEvents: | ||
- client: *client0 | ||
events: | ||
- commandStartedEvent: | ||
command: | ||
insert: *collection0Name | ||
documents: | ||
# We can make exact assertions here but we use the $$lte operator to ensure drivers support it. | ||
- { _id: { $$lte: 1 }, y: { $$lte: 2 } } | ||
commandName: insert | ||
databaseName: *database0Name |
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.