Skip to content

Commit 43d3e65

Browse files
committed
add specification tests
1 parent c1dccd1 commit 43d3e65

17 files changed

+12132
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
{
2+
"description": "unacknowledged-client-bulkWrite",
3+
"schemaVersion": "1.0",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client",
8+
"observeEvents": [
9+
"commandStartedEvent",
10+
"commandSucceededEvent",
11+
"commandFailedEvent"
12+
],
13+
"uriOptions": {
14+
"w": 0
15+
}
16+
}
17+
},
18+
{
19+
"database": {
20+
"id": "database",
21+
"client": "client",
22+
"databaseName": "command-monitoring-tests"
23+
}
24+
},
25+
{
26+
"collection": {
27+
"id": "collection",
28+
"database": "database",
29+
"collectionName": "test"
30+
}
31+
}
32+
],
33+
"initialData": [
34+
{
35+
"collectionName": "test",
36+
"databaseName": "command-monitoring-tests",
37+
"documents": [
38+
{
39+
"_id": 1,
40+
"x": 11
41+
},
42+
{
43+
"_id": 2,
44+
"x": 22
45+
},
46+
{
47+
"_id": 3,
48+
"x": 33
49+
}
50+
]
51+
}
52+
],
53+
"_yamlAnchors": {
54+
"namespace": "command-monitoring-tests.test"
55+
},
56+
"tests": [
57+
{
58+
"description": "A successful mixed client bulkWrite",
59+
"operations": [
60+
{
61+
"object": "client",
62+
"name": "clientBulkWrite",
63+
"arguments": {
64+
"models": [
65+
{
66+
"insertOne": {
67+
"namespace": "command-monitoring-tests.test",
68+
"document": {
69+
"_id": 4,
70+
"x": 44
71+
}
72+
}
73+
},
74+
{
75+
"updateOne": {
76+
"namespace": "command-monitoring-tests.test",
77+
"filter": {
78+
"_id": 3
79+
},
80+
"update": {
81+
"$set": {
82+
"x": 333
83+
}
84+
}
85+
}
86+
}
87+
]
88+
},
89+
"expectResult": {
90+
"insertedCount": {
91+
"$$unsetOrMatches": 0
92+
},
93+
"upsertedCount": {
94+
"$$unsetOrMatches": 0
95+
},
96+
"matchedCount": {
97+
"$$unsetOrMatches": 0
98+
},
99+
"modifiedCount": {
100+
"$$unsetOrMatches": 0
101+
},
102+
"deletedCount": {
103+
"$$unsetOrMatches": 0
104+
},
105+
"insertResults": {
106+
"$$unsetOrMatches": {}
107+
},
108+
"updateResults": {
109+
"$$unsetOrMatches": {}
110+
},
111+
"deleteResults": {
112+
"$$unsetOrMatches": {}
113+
}
114+
}
115+
}
116+
],
117+
"expectEvents": [
118+
{
119+
"client": "client",
120+
"events": [
121+
{
122+
"commandStartedEvent": {
123+
"commandName": "bulkWrite",
124+
"databaseName": "admin",
125+
"command": {
126+
"bulkWrite": 1,
127+
"errorsOnly": true,
128+
"ordered": true,
129+
"ops": [
130+
{
131+
"insert": 0,
132+
"document": {
133+
"_id": 4,
134+
"x": 44
135+
}
136+
},
137+
{
138+
"update": 0,
139+
"filter": {
140+
"_id": 3
141+
},
142+
"updateMods": {
143+
"$set": {
144+
"x": 333
145+
}
146+
},
147+
"multi": false
148+
}
149+
],
150+
"nsInfo": [
151+
{
152+
"ns": "command-monitoring-tests.test"
153+
}
154+
]
155+
}
156+
}
157+
},
158+
{
159+
"commandSucceededEvent": {
160+
"commandName": "bulkWrite",
161+
"reply": {
162+
"ok": 1,
163+
"nInserted": {
164+
"$$exists": false
165+
},
166+
"nMatched": {
167+
"$$exists": false
168+
},
169+
"nModified": {
170+
"$$exists": false
171+
},
172+
"nUpserted": {
173+
"$$exists": false
174+
},
175+
"nDeleted": {
176+
"$$exists": false
177+
}
178+
}
179+
}
180+
}
181+
]
182+
}
183+
]
184+
}
185+
]
186+
}

0 commit comments

Comments
 (0)