Skip to content

CXX-2697 Add search index spec tests and management helpers #986

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 47 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2bbfd3e
add spec tests
joshbsiegel Jun 28, 2023
27773c4
search_index_model
joshbsiegel Jul 3, 2023
bcaf008
search_index_view options
joshbsiegel Jul 3, 2023
e02cd76
search_index_view.hpp
joshbsiegel Jul 3, 2023
a6bbb0e
update makefiles
joshbsiegel Jul 5, 2023
713cdf4
createSearchIndex, createSearchIndexes spec tests, private file
joshbsiegel Jul 5, 2023
7b45432
operation handling for all commands (no implementation yet)
joshbsiegel Jul 6, 2023
7500df2
make search_index name optional
joshbsiegel Jul 6, 2023
a0c3af7
create_one, create_many implementations
joshbsiegel Jul 6, 2023
e256ff2
change variable name to definition
joshbsiegel Jul 6, 2023
7f32ede
drop_one, update_one implementations
joshbsiegel Jul 6, 2023
2423791
list_search_indexes implementation
joshbsiegel Jul 7, 2023
93bdb41
fix returns from operations.cpp
joshbsiegel Jul 7, 2023
1a20fea
index management in runner.cpp
joshbsiegel Jul 7, 2023
df5e846
clean up comments and unnecessary code
joshbsiegel Jul 7, 2023
11ffdd9
empty out search index view test file
joshbsiegel Jul 11, 2023
a13bc2b
fix to_string
joshbsiegel Jul 11, 2023
4a4e808
set unused parameters
joshbsiegel Jul 11, 2023
f9d6f63
evergreen fix
joshbsiegel Jul 11, 2023
89a646d
noexcept on impl
joshbsiegel Jul 11, 2023
1ab4f0a
add friend declaration
joshbsiegel Jul 11, 2023
7677a95
removing noexcept from search_index_model move assign
joshbsiegel Jul 11, 2023
959d256
cmake fix
joshbsiegel Jul 11, 2023
54b670e
modify _name to bsoncxx::string::view_or_value
joshbsiegel Jul 14, 2023
4e0b8f5
remove options::search_index_view
joshbsiegel Jul 14, 2023
69a15ca
bring back copy assignment operator
joshbsiegel Jul 14, 2023
afe5b8c
remove unnecessary headers
joshbsiegel Jul 14, 2023
1973221
comment changes, string to string::view_or_value, function name changes
joshbsiegel Jul 14, 2023
ffc0d45
add session overloads
joshbsiegel Jul 17, 2023
ce3fc66
options::aggregate
joshbsiegel Jul 17, 2023
78fffbb
abstract append code and add read preference to list
joshbsiegel Jul 17, 2023
2de13bd
iterate over all aggregation options in the spec tests
joshbsiegel Jul 18, 2023
4ae438b
remove to_string redundancy
joshbsiegel Jul 19, 2023
dd27e87
pass view-like types by value
joshbsiegel Jul 19, 2023
9be123b
empty test file and clean up CMakeLists.txt
joshbsiegel Jul 19, 2023
ae48151
append_aggregate_options.hh fixes
joshbsiegel Jul 19, 2023
e2ad0df
add search_index_view forward declaration
joshbsiegel Jul 19, 2023
a7c8bea
const and non-const overloads for search_index_view::_get_impl()
joshbsiegel Jul 19, 2023
87711bd
PIMPL structure for search_index_model
joshbsiegel Jul 20, 2023
fd66367
ssearch_index_view.hh big 5 fixes
joshbsiegel Jul 20, 2023
2b8221b
remove optional return from create_one
joshbsiegel Jul 20, 2023
373fce8
removing unused parameter
joshbsiegel Jul 20, 2023
80e905a
return std::string from create_one
joshbsiegel Jul 20, 2023
f5ab8e4
misc cleanup
joshbsiegel Jul 20, 2023
2665ebd
simplifying search_index_model::impl, adding error code, allowing sea…
joshbsiegel Jul 20, 2023
cab841f
error_code::k_invalid_search_index_view
joshbsiegel Jul 20, 2023
f3b3d7f
fix headers
joshbsiegel Jul 20, 2023
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
1 change: 1 addition & 0 deletions .mci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ functions:
export URI_OPTIONS_TESTS_PATH="$(pwd)/../data/uri-options"
export VERSIONED_API_TESTS_PATH=$(pwd)/../data/versioned-api
export WITH_TRANSACTION_TESTS_PATH="$(pwd)/../data/with_transaction"
export INDEX_MANAGEMENT_TESTS_PATH=$(pwd)/../data/index-management

export MONGODB_API_VERSION="${MONGODB_API_VERSION}"

Expand Down
134 changes: 134 additions & 0 deletions data/index-management/createSearchIndex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"description": "createSearchIndex",
"schemaVersion": "1.4",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "database0"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "collection0"
}
}
],
"runOnRequirements": [
{
"minServerVersion": "7.0.0",
"topologies": [
"replicaset",
"load-balanced",
"sharded"
],
"serverless": "forbid"
}
],
"tests": [
{
"description": "no name provided for an index definition",
"operations": [
{
"name": "createSearchIndex",
"object": "collection0",
"arguments": {
"model": {
"definition": {
"mappings": {
"dynamic": true
}
}
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"createSearchIndexes": "collection0",
"indexes": [
{
"definition": {
"mappings": {
"dynamic": true
}
}
}
],
"$db": "database0"
}
}
}
]
}
]
},
{
"description": "name provided for an index definition",
"operations": [
{
"name": "createSearchIndex",
"object": "collection0",
"arguments": {
"model": {
"definition": {
"mappings": {
"dynamic": true
}
},
"name": "test index"
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"createSearchIndexes": "collection0",
"indexes": [
{
"definition": {
"mappings": {
"dynamic": true
}
},
"name": "test index"
}
],
"$db": "database0"
}
}
}
]
}
]
}
]
}
169 changes: 169 additions & 0 deletions data/index-management/createSearchIndexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"description": "createSearchIndexes",
"schemaVersion": "1.4",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "database0"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "collection0"
}
}
],
"runOnRequirements": [
{
"minServerVersion": "7.0.0",
"topologies": [
"replicaset",
"load-balanced",
"sharded"
],
"serverless": "forbid"
}
],
"tests": [
{
"description": "empty index definition array",
"operations": [
{
"name": "createSearchIndexes",
"object": "collection0",
"arguments": {
"models": []
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"createSearchIndexes": "collection0",
"indexes": [],
"$db": "database0"
}
}
}
]
}
]
},
{
"description": "no name provided for an index definition",
"operations": [
{
"name": "createSearchIndexes",
"object": "collection0",
"arguments": {
"models": [
{
"definition": {
"mappings": {
"dynamic": true
}
}
}
]
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"createSearchIndexes": "collection0",
"indexes": [
{
"definition": {
"mappings": {
"dynamic": true
}
}
}
],
"$db": "database0"
}
}
}
]
}
]
},
{
"description": "name provided for an index definition",
"operations": [
{
"name": "createSearchIndexes",
"object": "collection0",
"arguments": {
"models": [
{
"definition": {
"mappings": {
"dynamic": true
}
},
"name": "test index"
}
]
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"createSearchIndexes": "collection0",
"indexes": [
{
"definition": {
"mappings": {
"dynamic": true
}
},
"name": "test index"
}
],
"$db": "database0"
}
}
}
]
}
]
}
]
}
73 changes: 73 additions & 0 deletions data/index-management/dropSearchIndex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"description": "dropSearchIndex",
"schemaVersion": "1.4",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "database0"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "collection0"
}
}
],
"runOnRequirements": [
{
"minServerVersion": "7.0.0",
"topologies": [
"replicaset",
"load-balanced",
"sharded"
],
"serverless": "forbid"
}
],
"tests": [
{
"description": "sends the correct command",
"operations": [
{
"name": "dropSearchIndex",
"object": "collection0",
"arguments": {
"name": "test index"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"dropSearchIndex": "collection0",
"name": "test index",
"$db": "database0"
}
}
}
]
}
]
}
]
}
Loading