Skip to content

Commit 850903d

Browse files
add all unified tests
1 parent bd2e831 commit 850903d

File tree

90 files changed

+40392
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+40392
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"description": "aggregate-merge",
3+
"schemaVersion": "1.0",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.1.11"
7+
}
8+
],
9+
"createEntities": [
10+
{
11+
"client": {
12+
"id": "client0",
13+
"useMultipleMongoses": false,
14+
"observeEvents": [
15+
"commandStartedEvent"
16+
]
17+
}
18+
},
19+
{
20+
"database": {
21+
"id": "database0",
22+
"client": "client0",
23+
"databaseName": "retryable-reads-tests"
24+
}
25+
},
26+
{
27+
"collection": {
28+
"id": "collection0",
29+
"database": "database0",
30+
"collectionName": "coll"
31+
}
32+
}
33+
],
34+
"initialData": [
35+
{
36+
"collectionName": "coll",
37+
"databaseName": "retryable-reads-tests",
38+
"documents": [
39+
{
40+
"_id": 1,
41+
"x": 11
42+
},
43+
{
44+
"_id": 2,
45+
"x": 22
46+
},
47+
{
48+
"_id": 3,
49+
"x": 33
50+
}
51+
]
52+
}
53+
],
54+
"tests": [
55+
{
56+
"description": "Aggregate with $merge does not retry",
57+
"operations": [
58+
{
59+
"object": "testRunner",
60+
"name": "failPoint",
61+
"arguments": {
62+
"client": "client0",
63+
"failPoint": {
64+
"configureFailPoint": "failCommand",
65+
"mode": {
66+
"times": 1
67+
},
68+
"data": {
69+
"failCommands": [
70+
"aggregate"
71+
],
72+
"closeConnection": true
73+
}
74+
}
75+
}
76+
},
77+
{
78+
"object": "collection0",
79+
"name": "aggregate",
80+
"arguments": {
81+
"pipeline": [
82+
{
83+
"$match": {
84+
"_id": {
85+
"$gt": 1
86+
}
87+
}
88+
},
89+
{
90+
"$sort": {
91+
"x": 1
92+
}
93+
},
94+
{
95+
"$merge": {
96+
"into": "output-collection"
97+
}
98+
}
99+
]
100+
},
101+
"expectError": {
102+
"isError": true
103+
}
104+
}
105+
],
106+
"expectEvents": [
107+
{
108+
"client": "client0",
109+
"events": [
110+
{
111+
"commandStartedEvent": {
112+
"command": {
113+
"aggregate": "coll",
114+
"pipeline": [
115+
{
116+
"$match": {
117+
"_id": {
118+
"$gt": 1
119+
}
120+
}
121+
},
122+
{
123+
"$sort": {
124+
"x": 1
125+
}
126+
},
127+
{
128+
"$merge": {
129+
"into": "output-collection"
130+
}
131+
}
132+
]
133+
},
134+
"commandName": "aggregate",
135+
"databaseName": "retryable-reads-tests"
136+
}
137+
}
138+
]
139+
}
140+
]
141+
}
142+
]
143+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
description: aggregate-merge
2+
3+
schemaVersion: '1.0'
4+
5+
runOnRequirements:
6+
-
7+
minServerVersion: 4.1.11
8+
9+
createEntities:
10+
-
11+
client:
12+
id: &client0 client0
13+
useMultipleMongoses: false
14+
observeEvents:
15+
- commandStartedEvent
16+
-
17+
database:
18+
id: &database0 database0
19+
client: *client0
20+
databaseName: &database_name retryable-reads-tests
21+
-
22+
collection:
23+
id: &collection0 collection0
24+
database: *database0
25+
collectionName: &collection_name coll
26+
27+
initialData:
28+
-
29+
collectionName: *collection_name
30+
databaseName: *database_name
31+
documents:
32+
-
33+
_id: 1
34+
x: 11
35+
-
36+
_id: 2
37+
x: 22
38+
-
39+
_id: 3
40+
x: 33
41+
42+
tests:
43+
-
44+
description: 'Aggregate with $merge does not retry'
45+
operations:
46+
-
47+
object: testRunner
48+
name: failPoint
49+
arguments:
50+
client: *client0
51+
failPoint:
52+
configureFailPoint: failCommand
53+
mode:
54+
times: 1
55+
data:
56+
failCommands:
57+
- aggregate
58+
closeConnection: true
59+
-
60+
object: *collection0
61+
name: aggregate
62+
arguments:
63+
pipeline: &pipeline
64+
-
65+
$match:
66+
_id:
67+
$gt: 1
68+
-
69+
$sort:
70+
x: 1
71+
-
72+
$merge:
73+
into: output-collection
74+
expectError:
75+
isError: true
76+
expectEvents:
77+
-
78+
client: *client0
79+
events:
80+
-
81+
commandStartedEvent:
82+
command:
83+
aggregate: *collection_name
84+
pipeline: *pipeline
85+
commandName: aggregate
86+
databaseName: *database_name

0 commit comments

Comments
 (0)