Skip to content

Commit bff9af5

Browse files
committed
test: update read write concern tests
1 parent 608bdfd commit bff9af5

8 files changed

+23
-64
lines changed

test/spec/read-write-concern/operation/default-write-concern-2.6.json

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
"q": {},
4545
"limit": 1
4646
}
47-
],
48-
"writeConcern": null
47+
]
4948
}
5049
}
5150
}
@@ -78,8 +77,7 @@
7877
"q": {},
7978
"limit": 0
8079
}
81-
],
82-
"writeConcern": null
80+
]
8381
}
8482
}
8583
}
@@ -213,8 +211,7 @@
213211
{
214212
"_id": 1
215213
}
216-
],
217-
"writeConcern": null
214+
]
218215
}
219216
}
220217
},
@@ -233,8 +230,7 @@
233230
}
234231
}
235232
}
236-
],
237-
"writeConcern": null
233+
]
238234
}
239235
}
240236
},
@@ -246,8 +242,7 @@
246242
{
247243
"_id": 2
248244
}
249-
],
250-
"writeConcern": null
245+
]
251246
}
252247
}
253248
},
@@ -264,8 +259,7 @@
264259
"x": 2
265260
}
266261
}
267-
],
268-
"writeConcern": null
262+
]
269263
}
270264
}
271265
},
@@ -277,8 +271,7 @@
277271
{
278272
"_id": 3
279273
}
280-
],
281-
"writeConcern": null
274+
]
282275
}
283276
}
284277
},
@@ -298,8 +291,7 @@
298291
},
299292
"multi": true
300293
}
301-
],
302-
"writeConcern": null
294+
]
303295
}
304296
}
305297
},
@@ -314,8 +306,7 @@
314306
},
315307
"limit": 1
316308
}
317-
],
318-
"writeConcern": null
309+
]
319310
}
320311
}
321312
}
@@ -494,8 +485,7 @@
494485
}
495486
}
496487
}
497-
],
498-
"writeConcern": null
488+
]
499489
}
500490
}
501491
},
@@ -515,8 +505,7 @@
515505
},
516506
"multi": true
517507
}
518-
],
519-
"writeConcern": null
508+
]
520509
}
521510
}
522511
},
@@ -533,8 +522,7 @@
533522
"x": 3
534523
}
535524
}
536-
],
537-
"writeConcern": null
525+
]
538526
}
539527
}
540528
}

test/spec/read-write-concern/operation/default-write-concern-2.6.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ tests:
2727
delete: *collection_name
2828
deletes:
2929
- {q: {}, limit: 1}
30-
writeConcern: null
3130
- description: DeleteMany omits default write concern
3231
operations:
3332
- name: deleteMany
@@ -42,7 +41,6 @@ tests:
4241
command:
4342
delete: *collection_name
4443
deletes: [{q: {}, limit: 0}]
45-
writeConcern: null
4644
- description: BulkWrite with all models omits default write concern
4745
operations:
4846
- name: bulkWrite
@@ -95,42 +93,35 @@ tests:
9593
insert: *collection_name
9694
documents:
9795
- {_id: 1}
98-
writeConcern: null
9996
- command_started_event:
10097
command:
10198
update: *collection_name
10299
updates:
103100
- {q: {_id: 1}, u: {$set: {x: 1}}}
104-
writeConcern: null
105101
- command_started_event:
106102
command:
107103
insert: *collection_name
108104
documents:
109105
- {_id: 2}
110-
writeConcern: null
111106
- command_started_event:
112107
command:
113108
update: *collection_name
114109
updates:
115110
- {q: {_id: 1}, u: {x: 2}}
116-
writeConcern: null
117111
- command_started_event:
118112
command:
119113
insert: *collection_name
120114
documents:
121115
- {_id: 3}
122-
writeConcern: null
123116
- command_started_event:
124117
command:
125118
update: *collection_name
126119
updates:
127120
- {q: {_id: 1}, u: {$set: {x: 3}}, multi: true}
128-
writeConcern: null
129121
- command_started_event:
130122
command:
131123
delete: *collection_name
132124
deletes: [{q: {_id: 3}, limit: 1}]
133-
writeConcern: null
134125
- description: 'InsertOne and InsertMany omit default write concern'
135126
operations:
136127
- name: insertOne
@@ -200,16 +191,13 @@ tests:
200191
update: *collection_name
201192
updates:
202193
- {q: {_id: 1}, u: {$set: {x: 1}}}
203-
writeConcern: null
204194
- command_started_event:
205195
command:
206196
update: *collection_name
207197
updates:
208198
- {q: {_id: 2}, u: {$set: {x: 2}}, multi: true}
209-
writeConcern: null
210199
- command_started_event:
211200
command:
212201
update: *collection_name
213202
updates:
214-
- {q: {_id: 2}, u: {x: 3}}
215-
writeConcern: null
203+
- {q: {_id: 2}, u: {x: 3}}

test/spec/read-write-concern/operation/default-write-concern-3.2.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@
8888
"$set": {
8989
"x": 1
9090
}
91-
},
92-
"writeConcern": null
91+
}
9392
}
9493
}
9594
},
@@ -102,8 +101,7 @@
102101
},
103102
"update": {
104103
"x": 2
105-
},
106-
"writeConcern": null
104+
}
107105
}
108106
}
109107
},
@@ -114,8 +112,7 @@
114112
"query": {
115113
"_id": 2
116114
},
117-
"remove": true,
118-
"writeConcern": null
115+
"remove": true
119116
}
120117
}
121118
}

test/spec/read-write-concern/operation/default-write-concern-3.2.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,13 @@ tests:
4343
findAndModify: *collection_name
4444
query: {_id: 1}
4545
update: {$set: {x: 1}}
46-
writeConcern: null
4746
- command_started_event:
4847
command:
4948
findAndModify: *collection_name
5049
query: {_id: 2}
5150
update: {x: 2}
52-
writeConcern: null
5351
- command_started_event:
5452
command:
5553
findAndModify: *collection_name
5654
query: {_id: 2}
57-
remove: true
58-
writeConcern: null
55+
remove: true

test/spec/read-write-concern/operation/default-write-concern-3.4.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
{
7070
"$out": "other_collection_name"
7171
}
72-
],
73-
"writeConcern": null
72+
]
7473
}
7574
}
7675
}
@@ -109,8 +108,7 @@
109108
"q": {},
110109
"limit": 1
111110
}
112-
],
113-
"writeConcern": null
111+
]
114112
}
115113
}
116114
}
@@ -163,8 +161,7 @@
163161
"command_started_event": {
164162
"command": {
165163
"dropIndexes": "default_write_concern_coll",
166-
"index": "x_1",
167-
"writeConcern": null
164+
"index": "x_1"
168165
}
169166
}
170167
}
@@ -205,8 +202,7 @@
205202
},
206203
"out": {
207204
"inline": 1
208-
},
209-
"writeConcern": null
205+
}
210206
}
211207
}
212208
}

test/spec/read-write-concern/operation/default-write-concern-3.4.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ tests:
3232
command:
3333
aggregate: *collection_name
3434
pipeline: *out_pipeline
35-
writeConcern: null
3635
- description: RunCommand with a write command omits default write concern (runCommand should never inherit write concern)
3736
operations:
3837
- object: database
@@ -50,7 +49,6 @@ tests:
5049
delete: *collection_name
5150
deletes:
5251
- {q: {}, limit: 1}
53-
writeConcern: null
5452
- description: CreateIndex and dropIndex omits default write concern
5553
operations:
5654
- object: collection
@@ -75,7 +73,6 @@ tests:
7573
command:
7674
dropIndexes: *collection_name
7775
index: x_1
78-
writeConcern: null
7976
- description: MapReduce omits default write concern
8077
operations:
8178
- name: mapReduce
@@ -91,5 +88,4 @@ tests:
9188
mapReduce: *collection_name
9289
map: { $code: 'function inc() { return emit(0, this.x + 1) }' }
9390
reduce: { $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' }
94-
out: { inline: 1 }
95-
writeConcern: null
91+
out: { inline: 1 }

test/spec/read-write-concern/operation/default-write-concern-4.2.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@
6565
"into": "other_collection_name"
6666
}
6767
}
68-
],
69-
"writeConcern": null
68+
]
7069
}
7170
}
7271
}

test/spec/read-write-concern/operation/default-write-concern-4.2.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ tests:
2727
command:
2828
aggregate: *collection_name
2929
pipeline: *merge_pipeline
30-
# "null" fields will be checked for non-existence
31-
writeConcern: null
3230
outcome:
3331
collection:
3432
name: *other_collection_name

0 commit comments

Comments
 (0)