Skip to content

Commit

Permalink
DRIVERS-2192 Fix comment helper specification tests (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusgeo committed Feb 8, 2022
1 parent 71c67c0 commit 96caeef
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 94 deletions.
62 changes: 27 additions & 35 deletions source/crud/tests/unified/bulkWrite-comment.json
Expand Up @@ -88,7 +88,9 @@
"_id": 2
},
"update": {
"x": "updated"
"$set": {
"x": "updated"
}
}
}
},
Expand All @@ -106,7 +108,9 @@
"deletedCount": 1,
"insertedCount": 1,
"insertedIds": {
"0": 5
"$$unsetOrMatches": {
"0": 5
}
},
"matchedCount": 2,
"modifiedCount": 2,
Expand Down Expand Up @@ -147,24 +151,15 @@
"_id": 1,
"x": "replaced"
}
}
],
"ordered": true,
"comment": "comment"
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "BulkWrite_comment",
"updates": [
},
{
"q": {
"_id": 2
},
"u": {
"x": "updated"
"$set": {
"x": "updated"
}
}
}
],
Expand All @@ -181,7 +176,8 @@
{
"q": {
"_id": 3
}
},
"limit": 1
}
],
"ordered": true,
Expand Down Expand Up @@ -255,7 +251,9 @@
"_id": 2
},
"update": {
"x": "updated"
"$set": {
"x": "updated"
}
}
}
},
Expand All @@ -275,7 +273,9 @@
"deletedCount": 1,
"insertedCount": 1,
"insertedIds": {
"0": 5
"$$unsetOrMatches": {
"0": 5
}
},
"matchedCount": 2,
"modifiedCount": 2,
Expand Down Expand Up @@ -318,26 +318,15 @@
"_id": 1,
"x": "replaced"
}
}
],
"ordered": true,
"comment": {
"key": "value"
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "BulkWrite_comment",
"updates": [
},
{
"q": {
"_id": 2
},
"u": {
"x": "updated"
"$set": {
"x": "updated"
}
}
}
],
Expand All @@ -356,7 +345,8 @@
{
"q": {
"_id": 3
}
},
"limit": 1
}
],
"ordered": true,
Expand Down Expand Up @@ -432,7 +422,9 @@
"_id": 2
},
"update": {
"x": "updated"
"$set": {
"x": "updated"
}
}
}
},
Expand Down
18 changes: 4 additions & 14 deletions source/crud/tests/unified/bulkWrite-comment.yml
Expand Up @@ -48,15 +48,15 @@ tests:
- updateOne:
filter: &updateOne_filter
_id: 2
update: &update { x: "updated" }
update: &update { $set: {x: "updated"} }
- deleteOne:
filter: &deleteOne_filter
_id: 3
comment: &string_comment "comment"
expectResult: &expect_results
deletedCount: 1
insertedCount: 1
insertedIds: { 0: 5 }
insertedIds: { $$unsetOrMatches: { 0: 5} }
matchedCount: 2
modifiedCount: 2
upsertedCount: 0
Expand All @@ -77,12 +77,6 @@ tests:
updates:
- q: *replaceOne_filter
u: *replacement
ordered: true
comment: *string_comment
- commandStartedEvent:
command:
update: *collection_name
updates:
- q: *updateOne_filter
u: *update
ordered: true
Expand All @@ -92,6 +86,7 @@ tests:
delete: *collection_name
deletes:
- q: *deleteOne_filter
limit: 1
ordered: true
comment: *string_comment
outcome: &outcome
Expand Down Expand Up @@ -133,12 +128,6 @@ tests:
updates:
- q: *replaceOne_filter
u: *replacement
ordered: true
comment: *document_comment
- commandStartedEvent:
command:
update: *collection_name
updates:
- q: *updateOne_filter
u: *update
ordered: true
Expand All @@ -148,6 +137,7 @@ tests:
delete: *collection_name
deletes:
- q: *deleteOne_filter
limit: 1
ordered: true
comment: *document_comment
outcome: *outcome
Expand Down
63 changes: 27 additions & 36 deletions source/crud/tests/unified/updateMany-comment.json
Expand Up @@ -53,13 +53,11 @@
"filter": {
"_id": 1
},
"update": [
{
"$set": {
"x": 22
}
"update": {
"$set": {
"x": 22
}
],
},
"comment": "comment"
}
}
Expand All @@ -77,13 +75,12 @@
"q": {
"_id": 1
},
"u": [
{
"$set": {
"x": 22
}
"u": {
"$set": {
"x": 22
}
]
},
"multi": true
}
],
"comment": "comment"
Expand Down Expand Up @@ -121,13 +118,11 @@
"filter": {
"_id": 1
},
"update": [
{
"$set": {
"x": 22
}
"update": {
"$set": {
"x": 22
}
],
},
"comment": {
"key": "value"
}
Expand All @@ -147,13 +142,12 @@
"q": {
"_id": 1
},
"u": [
{
"$set": {
"x": 22
}
"u": {
"$set": {
"x": 22
}
]
},
"multi": true
}
],
"comment": {
Expand Down Expand Up @@ -193,13 +187,11 @@
"filter": {
"_id": 1
},
"update": [
{
"$set": {
"x": 22
}
"update": {
"$set": {
"x": 22
}
],
},
"comment": "comment"
},
"expectError": {
Expand All @@ -220,13 +212,12 @@
"q": {
"_id": 1
},
"u": [
{
"$set": {
"x": 22
}
"u": {
"$set": {
"x": 22
}
]
},
"multi": true
}
],
"comment": "comment"
Expand Down
6 changes: 4 additions & 2 deletions source/crud/tests/unified/updateMany-comment.yml
Expand Up @@ -29,8 +29,7 @@ tests:
object: *collection0
arguments:
filter: &filter { _id: 1 }
update: &update
- $set: { x: 22 }
update: &update { $set: {x: 22} }
comment: "comment"
expectEvents:
- client: *client0
Expand All @@ -42,6 +41,7 @@ tests:
-
q: *filter
u: *update
multi: true
comment: "comment"
outcome: &outcome
- collectionName: *collection0Name
Expand Down Expand Up @@ -69,6 +69,7 @@ tests:
-
q: *filter
u: *update
multi: true
comment: *comment
outcome: *outcome

Expand All @@ -94,5 +95,6 @@ tests:
-
q: *filter
u: *update
multi: true
comment: "comment"
outcome: *initialData

0 comments on commit 96caeef

Please sign in to comment.