Skip to content

Commit 1415137

Browse files
GODRIVER-3074 Sync index management tests (mongodb#1510)
1 parent d46f29c commit 1415137

13 files changed

+445
-30
lines changed

mongo/integration/unified/unified_spec_runner.go

+7
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@ var (
2727
// GODRIVER-1773: This test runs a "find" with limit=4 and batchSize=3. It expects batchSize values of three for
2828
// the "find" and one for the "getMore", but we send three for both.
2929
"A successful find event with a getmore and the server kills the cursor (<= 4.4)": "See GODRIVER-1773",
30+
3031
// TODO(GODRIVER-2843): Fix and unskip these test cases.
3132
"Find operation with snapshot": "Test fails frequently. See GODRIVER-2843",
3233
"Write commands with snapshot session do not affect snapshot reads": "Test fails frequently. See GODRIVER-2843",
34+
35+
// TODO(GODRIVER-3043): Avoid Appending Write/Read Concern in Atlas Search
36+
// Index Helper Commands.
37+
"dropSearchIndex ignores read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
38+
"listSearchIndexes ignores read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
39+
"updateSearchIndex ignores the read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
3340
}
3441

3542
logMessageValidatorTimeout = 10 * time.Millisecond

testdata/index-management/createSearchIndex.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"expectError": {
5757
"isError": true,
58-
"errorContains": "Search index commands are only supported with Atlas"
58+
"errorContains": "Atlas"
5959
}
6060
}
6161
],
@@ -102,7 +102,7 @@
102102
},
103103
"expectError": {
104104
"isError": true,
105-
"errorContains": "Search index commands are only supported with Atlas"
105+
"errorContains": "Atlas"
106106
}
107107
}
108108
],
@@ -133,4 +133,4 @@
133133
]
134134
}
135135
]
136-
}
136+
}

testdata/index-management/createSearchIndex.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ tests:
3030
expectError:
3131
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
3232
# that the driver constructs and sends the correct command.
33+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
3334
isError: true
34-
errorContains: Search index commands are only supported with Atlas
35+
errorContains: Atlas
3536
expectEvents:
3637
- client: *client0
3738
events:
@@ -50,13 +51,14 @@ tests:
5051
expectError:
5152
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
5253
# that the driver constructs and sends the correct command.
54+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
5355
isError: true
54-
errorContains: Search index commands are only supported with Atlas
56+
errorContains: Atlas
5557
expectEvents:
5658
- client: *client0
5759
events:
5860
- commandStartedEvent:
5961
command:
6062
createSearchIndexes: *collection0
6163
indexes: [ { definition: *definition, name: 'test index' } ]
62-
$db: *database0
64+
$db: *database0

testdata/index-management/createSearchIndexes.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"expectError": {
5151
"isError": true,
52-
"errorContains": "Search index commands are only supported with Atlas"
52+
"errorContains": "Atlas"
5353
}
5454
}
5555
],
@@ -89,7 +89,7 @@
8989
},
9090
"expectError": {
9191
"isError": true,
92-
"errorContains": "Search index commands are only supported with Atlas"
92+
"errorContains": "Atlas"
9393
}
9494
}
9595
],
@@ -138,7 +138,7 @@
138138
},
139139
"expectError": {
140140
"isError": true,
141-
"errorContains": "Search index commands are only supported with Atlas"
141+
"errorContains": "Atlas"
142142
}
143143
}
144144
],
@@ -169,4 +169,4 @@
169169
]
170170
}
171171
]
172-
}
172+
}

testdata/index-management/createSearchIndexes.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ tests:
3030
expectError:
3131
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
3232
# that the driver constructs and sends the correct command.
33+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
3334
isError: true
34-
errorContains: Search index commands are only supported with Atlas
35+
errorContains: Atlas
3536
expectEvents:
3637
- client: *client0
3738
events:
@@ -51,8 +52,9 @@ tests:
5152
expectError:
5253
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
5354
# that the driver constructs and sends the correct command.
55+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
5456
isError: true
55-
errorContains: Search index commands are only supported with Atlas
57+
errorContains: Atlas
5658
expectEvents:
5759
- client: *client0
5860
events:
@@ -71,13 +73,14 @@ tests:
7173
expectError:
7274
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
7375
# that the driver constructs and sends the correct command.
76+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
7477
isError: true
75-
errorContains: Search index commands are only supported with Atlas
78+
errorContains: Atlas
7679
expectEvents:
7780
- client: *client0
7881
events:
7982
- commandStartedEvent:
8083
command:
8184
createSearchIndexes: *collection0
8285
indexes: [ { definition: *definition, name: 'test index' } ]
83-
$db: *database0
86+
$db: *database0

testdata/index-management/dropSearchIndex.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"expectError": {
5151
"isError": true,
52-
"errorContains": "Search index commands are only supported with Atlas"
52+
"errorContains": "Atlas"
5353
}
5454
}
5555
],
@@ -71,4 +71,4 @@
7171
]
7272
}
7373
]
74-
}
74+
}

testdata/index-management/dropSearchIndex.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ tests:
3030
expectError:
3131
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
3232
# that the driver constructs and sends the correct command.
33+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
3334
isError: true
34-
errorContains: Search index commands are only supported with Atlas
35+
errorContains: Atlas
3536
expectEvents:
3637
- client: *client0
3738
events:
3839
- commandStartedEvent:
3940
command:
4041
dropSearchIndex: *collection0
4142
name: *indexName
42-
$db: *database0
43+
$db: *database0

testdata/index-management/listSearchIndexes.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"object": "collection0",
4747
"expectError": {
4848
"isError": true,
49-
"errorContains": "Search index commands are only supported with Atlas"
49+
"errorContains": "Atlas"
5050
}
5151
}
5252
],
@@ -81,7 +81,7 @@
8181
},
8282
"expectError": {
8383
"isError": true,
84-
"errorContains": "Search index commands are only supported with Atlas"
84+
"errorContains": "Atlas"
8585
}
8686
}
8787
],
@@ -122,7 +122,7 @@
122122
},
123123
"expectError": {
124124
"isError": true,
125-
"errorContains": "Search index commands are only supported with Atlas"
125+
"errorContains": "Atlas"
126126
}
127127
}
128128
],
@@ -153,4 +153,4 @@
153153
]
154154
}
155155
]
156-
}
156+
}

testdata/index-management/listSearchIndexes.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ tests:
2828
expectError:
2929
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
3030
# that the driver constructs and sends the correct command.
31+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
3132
isError: true
32-
errorContains: Search index commands are only supported with Atlas
33+
errorContains: Atlas
3334
expectEvents:
3435
- client: *client0
3536
events:
@@ -48,8 +49,9 @@ tests:
4849
expectError:
4950
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
5051
# that the driver constructs and sends the correct command.
52+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
5153
isError: true
52-
errorContains: Search index commands are only supported with Atlas
54+
errorContains: Atlas
5355
expectEvents:
5456
- client: *client0
5557
events:
@@ -71,8 +73,9 @@ tests:
7173
expectError:
7274
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
7375
# that the driver constructs and sends the correct command.
76+
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
7477
isError: true
75-
errorContains: Search index commands are only supported with Atlas
78+
errorContains: Atlas
7679
expectEvents:
7780
- client: *client0
7881
events:
@@ -82,4 +85,4 @@ tests:
8285
cursor: { batchSize: 10 }
8386
pipeline:
8487
- $listSearchIndexes: { name: *indexName }
85-
$db: *database0
88+
$db: *database0

0 commit comments

Comments
 (0)