Skip to content

Commit 2e26e93

Browse files
committed
wip
1 parent 80c8fdf commit 2e26e93

File tree

3 files changed

+149
-148
lines changed

3 files changed

+149
-148
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { loadSpecTests } from '../../spec';
22
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
33

4-
describe('RunCommand spec', () => {
4+
describe.only('RunCommand spec', () => {
55
runUnifiedSuite(loadSpecTests('run-command'));
66
});

test/spec/run-command/run-command.json renamed to test/spec/run-command/runCommand.json

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
{
2-
"description": "runCommand spec requirements",
3-
"schemaVersion": "1.5",
2+
"description": "runCommand",
3+
"schemaVersion": "1.3",
44
"createEntities": [
55
{
66
"client": {
77
"id": "client",
8+
"useMultipleMongoses": false,
89
"observeEvents": [
910
"commandStartedEvent"
1011
]
1112
}
1213
},
1314
{
1415
"database": {
15-
"id": "plainDb",
16+
"id": "db",
1617
"client": "client",
17-
"databaseName": "plainDb"
18+
"databaseName": "db"
1819
}
1920
},
2021
{
2122
"collection": {
2223
"id": "collection",
23-
"database": "plainDb",
24+
"database": "db",
2425
"collectionName": "collection"
2526
}
2627
},
@@ -56,7 +57,7 @@
5657
},
5758
{
5859
"client": {
59-
"id": "stableApiClient",
60+
"id": "clientWithStableApi",
6061
"observeEvents": [
6162
"commandStartedEvent"
6263
],
@@ -68,21 +69,17 @@
6869
},
6970
{
7071
"database": {
71-
"id": "stableApiDb",
72-
"client": "stableApiClient",
73-
"databaseName": "stableApiDb"
72+
"id": "dbWithStableApi",
73+
"client": "clientWithStableApi",
74+
"databaseName": "dbWithStableApi"
7475
}
7576
}
7677
],
7778
"initialData": [
7879
{
7980
"collectionName": "collection",
80-
"databaseName": "plainDb",
81-
"documents": [
82-
{
83-
"_id": 0
84-
}
85-
]
81+
"databaseName": "db",
82+
"documents": []
8683
}
8784
],
8885
"tests": [
@@ -91,7 +88,7 @@
9188
"operations": [
9289
{
9390
"name": "runCommand",
94-
"object": "plainDb",
91+
"object": "db",
9592
"arguments": {
9693
"commandName": "ping",
9794
"command": {
@@ -111,7 +108,7 @@
111108
"commandStartedEvent": {
112109
"command": {
113110
"ping": 1,
114-
"$db": "plainDb"
111+
"$db": "db"
115112
},
116113
"commandName": "ping"
117114
}
@@ -121,11 +118,11 @@
121118
]
122119
},
123120
{
124-
"description": "attaches the provided session lsid to ping command",
121+
"description": "attaches the provided session lsid to given command",
125122
"operations": [
126123
{
127124
"name": "runCommand",
128-
"object": "plainDb",
125+
"object": "db",
129126
"arguments": {
130127
"commandName": "ping",
131128
"command": {
@@ -149,7 +146,7 @@
149146
"lsid": {
150147
"$$sessionLsid": "session"
151148
},
152-
"$db": "plainDb"
149+
"$db": "db"
153150
},
154151
"commandName": "ping"
155152
}
@@ -163,13 +160,15 @@
163160
"operations": [
164161
{
165162
"name": "runCommand",
166-
"object": "plainDb",
163+
"object": "db",
167164
"arguments": {
168165
"commandName": "ping",
169166
"command": {
170167
"ping": 1
171168
},
172-
"readPreference": "nearest"
169+
"readPreference": {
170+
"mode": "nearest"
171+
}
173172
},
174173
"expectResult": {
175174
"ok": 1
@@ -187,7 +186,7 @@
187186
"$readPreference": {
188187
"mode": "nearest"
189188
},
190-
"$db": "plainDb"
189+
"$db": "db"
191190
},
192191
"commandName": "ping"
193192
}
@@ -203,13 +202,11 @@
203202
"name": "runCommand",
204203
"object": "dbWithRC",
205204
"arguments": {
206-
"commandName": "ping",
205+
"commandName": "aggregate",
207206
"command": {
208-
"ping": 1
207+
"aggregate": 1,
208+
"pipeline": []
209209
}
210-
},
211-
"expectResult": {
212-
"ok": 1
213210
}
214211
}
215212
],
@@ -226,7 +223,7 @@
226223
},
227224
"$db": "dbWithRC"
228225
},
229-
"commandName": "ping"
226+
"commandName": "aggregate"
230227
}
231228
}
232229
]
@@ -240,9 +237,15 @@
240237
"name": "runCommand",
241238
"object": "dbWithWC",
242239
"arguments": {
243-
"commandName": "ping",
240+
"commandName": "insert",
244241
"command": {
245-
"ping": 1
242+
"insert": "collection",
243+
"documents": [
244+
{
245+
"_id": 1
246+
}
247+
],
248+
"ordered": true
246249
}
247250
},
248251
"expectResult": {
@@ -257,7 +260,7 @@
257260
{
258261
"commandStartedEvent": {
259262
"command": {
260-
"ping": 1,
263+
"insert": "collection",
261264
"writeConcern": {
262265
"$$exists": false
263266
},
@@ -294,15 +297,15 @@
294297
},
295298
{
296299
"name": "runCommand",
297-
"object": "plainDb",
300+
"object": "db",
298301
"arguments": {
299302
"commandName": "ping",
300303
"command": {
301304
"ping": 1
302305
}
303306
},
304307
"expectError": {
305-
"isError": true
308+
"isClientError": true
306309
}
307310
}
308311
]
@@ -311,13 +314,17 @@
311314
"description": "attaches transaction fields to given command",
312315
"runOnRequirements": [
313316
{
317+
"minServerVersion": "4.0",
318+
"topologies": [
319+
"replicaset"
320+
]
321+
},
322+
{
323+
"minServerVersion": "4.2",
314324
"topologies": [
315-
"replicaset",
316325
"sharded-replicaset",
317-
"load-balanced",
318-
"sharded"
319-
],
320-
"minServerVersion": "4.4"
326+
"load-balanced"
327+
]
321328
}
322329
],
323330
"operations": [
@@ -328,15 +335,15 @@
328335
"callback": [
329336
{
330337
"name": "runCommand",
331-
"object": "plainDb",
338+
"object": "db",
332339
"arguments": {
333340
"session": "session",
334341
"commandName": "insert",
335342
"command": {
336343
"insert": "collection",
337344
"documents": [
338345
{
339-
"_id": 1
346+
"_id": 2
340347
}
341348
],
342349
"ordered": true
@@ -364,7 +371,7 @@
364371
"insert": "collection",
365372
"documents": [
366373
{
367-
"_id": 1
374+
"_id": 2
368375
}
369376
],
370377
"ordered": true,
@@ -382,7 +389,7 @@
382389
}
383390
},
384391
"commandName": "insert",
385-
"databaseName": "plainDb"
392+
"databaseName": "db"
386393
}
387394
},
388395
{
@@ -414,7 +421,7 @@
414421
"operations": [
415422
{
416423
"name": "runCommand",
417-
"object": "stableApiDb",
424+
"object": "dbWithStableApi",
418425
"arguments": {
419426
"commandName": "ping",
420427
"command": {
@@ -428,13 +435,13 @@
428435
],
429436
"expectEvents": [
430437
{
431-
"client": "stableApiClient",
438+
"client": "clientWithStableApi",
432439
"events": [
433440
{
434441
"commandStartedEvent": {
435442
"command": {
436443
"ping": 1,
437-
"$db": "stableApiDb",
444+
"$db": "dbWithStableApi",
438445
"apiVersion": "1",
439446
"apiStrict": true,
440447
"apiDeprecationErrors": {

0 commit comments

Comments
 (0)