Skip to content

Commit a4874a4

Browse files
Sync up command monitoring specs
1 parent fa7908e commit a4874a4

File tree

7 files changed

+254
-175
lines changed

7 files changed

+254
-175
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/find.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@
390390
},
391391
{
392392
"description": "A successful find event with a getmore and the server kills the cursor (<= 4.4)",
393-
"comment": "UPDATED final batchSize to 3 as batchSize is no longer calculated see: DRIVERS-1448 ",
394393
"runOnRequirements": [
395394
{
396395
"minServerVersion": "3.1",
@@ -484,7 +483,7 @@
484483
]
485484
},
486485
"collection": "test",
487-
"batchSize": 3
486+
"batchSize": 1
488487
},
489488
"commandName": "getMore",
490489
"databaseName": "command-monitoring-tests"

0 commit comments

Comments
 (0)