Skip to content

Commit 3d61254

Browse files
Sync up command monitoring specs (#1538)
* Sync up command monitoring specs * Change the ticket id for the skipped case * change as per code review comments * revert back changes in find.json for outdated spec
1 parent f46bbdd commit 3d61254

File tree

3 files changed

+31
-173
lines changed

3 files changed

+31
-173
lines changed

driver-core/src/test/resources/unified-test-format/command-monitoring/command.json

Lines changed: 20 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
{
2-
"description": "command-logging",
3-
"schemaVersion": "1.13",
2+
"description": "command",
3+
"schemaVersion": "1.0",
44
"createEntities": [
55
{
66
"client": {
77
"id": "client",
8-
"observeLogMessages": {
9-
"command": "debug"
10-
}
8+
"observeEvents": [
9+
"commandStartedEvent",
10+
"commandSucceededEvent",
11+
"commandFailedEvent"
12+
]
1113
}
1214
},
1315
{
1416
"database": {
1517
"id": "database",
1618
"client": "client",
17-
"databaseName": "logging-tests"
19+
"databaseName": "command-monitoring-tests"
1820
}
1921
},
2022
{
2123
"collection": {
2224
"id": "collection",
2325
"database": "database",
24-
"collectionName": "logging-tests-collection"
26+
"collectionName": "test"
2527
}
2628
}
2729
],
2830
"initialData": [
2931
{
30-
"collectionName": "logging-tests-collection",
31-
"databaseName": "logging-tests",
32+
"collectionName": "test",
33+
"databaseName": "command-monitoring-tests",
3234
"documents": [
3335
{
3436
"_id": 1,
@@ -52,159 +54,25 @@
5254
}
5355
}
5456
],
55-
"expectLogMessages": [
57+
"expectEvents": [
5658
{
5759
"client": "client",
58-
"messages": [
60+
"events": [
5961
{
60-
"level": "debug",
61-
"component": "command",
62-
"data": {
63-
"message": "Command started",
64-
"databaseName": "logging-tests",
65-
"commandName": "ping",
62+
"commandStartedEvent": {
6663
"command": {
67-
"$$matchAsDocument": {
68-
"$$matchAsRoot": {
69-
"ping": 1,
70-
"$db": "logging-tests"
71-
}
72-
}
73-
},
74-
"requestId": {
75-
"$$type": [
76-
"int",
77-
"long"
78-
]
64+
"ping": 1
7965
},
80-
"serverHost": {
81-
"$$type": "string"
82-
},
83-
"serverPort": {
84-
"$$type": [
85-
"int",
86-
"long"
87-
]
88-
}
89-
}
90-
},
91-
{
92-
"level": "debug",
93-
"component": "command",
94-
"data": {
95-
"message": "Command succeeded",
96-
"databaseName": "logging-tests",
9766
"commandName": "ping",
98-
"reply": {
99-
"$$type": "string"
100-
},
101-
"requestId": {
102-
"$$type": [
103-
"int",
104-
"long"
105-
]
106-
},
107-
"serverHost": {
108-
"$$type": "string"
109-
},
110-
"serverPort": {
111-
"$$type": [
112-
"int",
113-
"long"
114-
]
115-
},
116-
"durationMS": {
117-
"$$type": [
118-
"double",
119-
"int",
120-
"long"
121-
]
122-
}
123-
}
124-
}
125-
]
126-
}
127-
]
128-
},
129-
{
130-
"description": "A failed command",
131-
"operations": [
132-
{
133-
"name": "find",
134-
"object": "collection",
135-
"arguments": {
136-
"filter": {
137-
"$or": true
138-
}
139-
},
140-
"expectError": {
141-
"isClientError": false
142-
}
143-
}
144-
],
145-
"expectLogMessages": [
146-
{
147-
"client": "client",
148-
"messages": [
149-
{
150-
"level": "debug",
151-
"component": "command",
152-
"data": {
153-
"message": "Command started",
154-
"databaseName": "logging-tests",
155-
"commandName": "find",
156-
"command": {
157-
"$$type": "string"
158-
},
159-
"requestId": {
160-
"$$type": [
161-
"int",
162-
"long"
163-
]
164-
},
165-
"serverHost": {
166-
"$$type": "string"
167-
},
168-
"serverPort": {
169-
"$$type": [
170-
"int",
171-
"long"
172-
]
173-
}
67+
"databaseName": "command-monitoring-tests"
17468
}
17569
},
17670
{
177-
"level": "debug",
178-
"component": "command",
179-
"data": {
180-
"message": "Command failed",
181-
"databaseName": "logging-tests",
182-
"commandName": "find",
183-
"failure": {
184-
"$$exists": true
185-
},
186-
"requestId": {
187-
"$$type": [
188-
"int",
189-
"long"
190-
]
191-
},
192-
"serverHost": {
193-
"$$type": "string"
194-
},
195-
"serverPort": {
196-
"$$type": [
197-
"int",
198-
"long"
199-
]
71+
"commandSucceededEvent": {
72+
"reply": {
73+
"ok": 1
20074
},
201-
"durationMS": {
202-
"$$type": [
203-
"double",
204-
"int",
205-
"long"
206-
]
207-
}
75+
"commandName": "ping"
20876
}
20977
}
21078
]

driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledgedBulkWrite.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,7 @@
7171
"object": "collection",
7272
"arguments": {
7373
"filter": {}
74-
},
75-
"expectResult": [
76-
{
77-
"_id": 1,
78-
"x": 11
79-
},
80-
{
81-
"_id": "unorderedBulkWriteInsertW0",
82-
"x": 44
83-
}
84-
]
74+
}
8575
}
8676
],
8777
"expectEvents": [

driver-core/src/test/resources/unified-test-format/command-monitoring/writeConcernError.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"description": "writeConcernError",
3-
"schemaVersion": "1.13",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "4.1.0",
6+
"minServerVersion": "4.3.1",
77
"topologies": [
88
"replicaset"
99
],
@@ -66,11 +66,11 @@
6666
"failCommands": [
6767
"insert"
6868
],
69+
"errorLabels": [
70+
"RetryableWriteError"
71+
],
6972
"writeConcernError": {
70-
"code": 91,
71-
"errorLabels": [
72-
"RetryableWriteError"
73-
]
73+
"code": 91
7474
}
7575
}
7676
}
@@ -112,11 +112,11 @@
112112
"reply": {
113113
"ok": 1,
114114
"n": 1,
115+
"errorLabels": [
116+
"RetryableWriteError"
117+
],
115118
"writeConcernError": {
116-
"code": 91,
117-
"errorLabels": [
118-
"RetryableWriteError"
119-
]
119+
"code": 91
120120
}
121121
},
122122
"commandName": "insert"

0 commit comments

Comments
 (0)