Skip to content

Commit 2f26354

Browse files
test: add change stream cluster time unified tests
1 parent 085471d commit 2f26354

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"description": "change-streams-clusterTime",
3+
"schemaVersion": "1.3",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0",
8+
"useMultipleMongoses": false
9+
}
10+
},
11+
{
12+
"database": {
13+
"id": "database0",
14+
"client": "client0",
15+
"databaseName": "database0"
16+
}
17+
},
18+
{
19+
"collection": {
20+
"id": "collection0",
21+
"database": "database0",
22+
"collectionName": "collection0"
23+
}
24+
}
25+
],
26+
"runOnRequirements": [
27+
{
28+
"minServerVersion": "4.0.0",
29+
"topologies": [
30+
"replicaset",
31+
"sharded-replicaset",
32+
"load-balanced",
33+
"sharded"
34+
]
35+
}
36+
],
37+
"initialData": [
38+
{
39+
"collectionName": "collection0",
40+
"databaseName": "database0",
41+
"documents": []
42+
}
43+
],
44+
"tests": [
45+
{
46+
"description": "clusterTime is present",
47+
"operations": [
48+
{
49+
"name": "createChangeStream",
50+
"object": "collection0",
51+
"arguments": {
52+
"pipeline": []
53+
},
54+
"saveResultAsEntity": "changeStream0"
55+
},
56+
{
57+
"name": "insertOne",
58+
"object": "collection0",
59+
"arguments": {
60+
"document": {
61+
"_id": 1
62+
}
63+
}
64+
},
65+
{
66+
"name": "iterateUntilDocumentOrError",
67+
"object": "changeStream0",
68+
"expectResult": {
69+
"ns": {
70+
"db": "database0",
71+
"coll": "collection0"
72+
},
73+
"clusterTime": {
74+
"$$exists": true
75+
}
76+
}
77+
}
78+
]
79+
}
80+
]
81+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
description: "change-streams-clusterTime"
2+
schemaVersion: "1.3"
3+
createEntities:
4+
- client:
5+
id: &client0 client0
6+
useMultipleMongoses: false
7+
- database:
8+
id: &database0 database0
9+
client: *client0
10+
databaseName: *database0
11+
- collection:
12+
id: &collection0 collection0
13+
database: *database0
14+
collectionName: *collection0
15+
16+
runOnRequirements:
17+
- minServerVersion: "4.0.0"
18+
topologies: [ replicaset, sharded-replicaset, load-balanced, sharded ]
19+
20+
initialData:
21+
- collectionName: *collection0
22+
databaseName: *database0
23+
documents: []
24+
25+
tests:
26+
- description: "clusterTime is present"
27+
operations:
28+
- name: createChangeStream
29+
object: *collection0
30+
arguments: { pipeline: [] }
31+
saveResultAsEntity: &changeStream0 changeStream0
32+
- name: insertOne
33+
object: *collection0
34+
arguments:
35+
document: { _id: 1 }
36+
- name: iterateUntilDocumentOrError
37+
object: *changeStream0
38+
expectResult:
39+
ns: { db: *database0, coll: *collection0 }
40+
clusterTime: { $$exists: true }

0 commit comments

Comments
 (0)