Skip to content

GODRIVER-3074 Sync index management tests #1510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mongo/integration/unified/unified_spec_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ var (
// GODRIVER-1773: This test runs a "find" with limit=4 and batchSize=3. It expects batchSize values of three for
// the "find" and one for the "getMore", but we send three for both.
"A successful find event with a getmore and the server kills the cursor (<= 4.4)": "See GODRIVER-1773",

// TODO(GODRIVER-2843): Fix and unskip these test cases.
"Find operation with snapshot": "Test fails frequently. See GODRIVER-2843",
"Write commands with snapshot session do not affect snapshot reads": "Test fails frequently. See GODRIVER-2843",

// TODO(GODRIVER-3043): Avoid Appending Write/Read Concern in Atlas Search
// Index Helper Commands.
"dropSearchIndex ignores read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
"listSearchIndexes ignores read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
"updateSearchIndex ignores the read and write concern": "Sync GODRIVER-3074, but skip testing bug GODRIVER-3043",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The searchIndexIgnoresReadWriteConcern.json tests are supposed to be added in GODRIVER-3043. However, this ticket was backlogged. Since some of the tests pass and because doing this ticket first could put GODRIVER-3043 out of sync I decided to include those tests here and ignore the failures.

}

logMessageValidatorTimeout = 10 * time.Millisecond
Expand Down
6 changes: 3 additions & 3 deletions testdata/index-management/createSearchIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -102,7 +102,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -133,4 +133,4 @@
]
}
]
}
}
8 changes: 5 additions & 3 deletions testdata/index-management/createSearchIndex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -50,13 +51,14 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
createSearchIndexes: *collection0
indexes: [ { definition: *definition, name: 'test index' } ]
$db: *database0
$db: *database0
8 changes: 4 additions & 4 deletions testdata/index-management/createSearchIndexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -89,7 +89,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -138,7 +138,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -169,4 +169,4 @@
]
}
]
}
}
11 changes: 7 additions & 4 deletions testdata/index-management/createSearchIndexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -51,8 +52,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -71,13 +73,14 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
createSearchIndexes: *collection0
indexes: [ { definition: *definition, name: 'test index' } ]
$db: *database0
$db: *database0
4 changes: 2 additions & 2 deletions testdata/index-management/dropSearchIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand All @@ -71,4 +71,4 @@
]
}
]
}
}
5 changes: 3 additions & 2 deletions testdata/index-management/dropSearchIndex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
dropSearchIndex: *collection0
name: *indexName
$db: *database0
$db: *database0
8 changes: 4 additions & 4 deletions testdata/index-management/listSearchIndexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"object": "collection0",
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -81,7 +81,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -122,7 +122,7 @@
},
"expectError": {
"isError": true,
"errorContains": "Search index commands are only supported with Atlas"
"errorContains": "Atlas"
}
}
],
Expand Down Expand Up @@ -153,4 +153,4 @@
]
}
]
}
}
11 changes: 7 additions & 4 deletions testdata/index-management/listSearchIndexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -48,8 +49,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -71,8 +73,9 @@ tests:
expectError:
# This test always errors in a non-Atlas environment. The test functions as a unit test by asserting
# that the driver constructs and sends the correct command.
# The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages.
isError: true
errorContains: Search index commands are only supported with Atlas
errorContains: Atlas
expectEvents:
- client: *client0
events:
Expand All @@ -82,4 +85,4 @@ tests:
cursor: { batchSize: 10 }
pipeline:
- $listSearchIndexes: { name: *indexName }
$db: *database0
$db: *database0
Loading