Skip to content

Commit 3172142

Browse files
authored
RUST-1684 End-to-end tests for the search index management helpers (#991)
1 parent c4de516 commit 3172142

File tree

5 files changed

+364
-5
lines changed

5 files changed

+364
-5
lines changed

.evergreen/config.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ buildvariants:
390390
tasks:
391391
- .load-balancer
392392

393+
- name: search-index
394+
display_name: "Search Index Helpers"
395+
patchable: true # TODO RUST-1684 change to false before merge
396+
run_on:
397+
- rhel87-small
398+
tasks:
399+
- name: search-index-task-group
400+
393401
###############
394402
# Task Groups #
395403
###############
@@ -551,6 +559,42 @@ task_groups:
551559
tasks:
552560
- test-gcp-kms
553561

562+
- name: search-index-task-group
563+
setup_group_can_fail_task: true
564+
setup_group_timeout_secs: 1800 # 30 minutes
565+
setup_group:
566+
- func: "fetch source"
567+
- func: "create expansions"
568+
- func: "prepare resources"
569+
- func: "windows fix"
570+
- func: "fix absolute paths"
571+
- func: "init test-results"
572+
- func: "make files executable"
573+
- func: "install rust"
574+
- func: "install junit dependencies"
575+
- command: subprocess.exec
576+
params:
577+
working_dir: src
578+
binary: bash
579+
add_expansions_to_env: true
580+
env:
581+
MONGODB_VERSION: "7.0"
582+
args:
583+
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
584+
- command: expansions.update
585+
params:
586+
file: src/atlas-expansion.yml
587+
teardown_group:
588+
- command: subprocess.exec
589+
params:
590+
working_dir: src
591+
binary: bash
592+
add_expansions_to_env: true
593+
args:
594+
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
595+
tasks:
596+
- test-search-index
597+
554598
#########
555599
# Tasks #
556600
#########
@@ -953,6 +997,16 @@ tasks:
953997
${AZURE_SHELL}
954998
.evergreen/run-azure-kms-test.sh
955999
1000+
- name: test-search-index
1001+
commands:
1002+
- command: subprocess.exec
1003+
params:
1004+
working_dir: src
1005+
binary: bash
1006+
add_expansions_to_env: true
1007+
args:
1008+
- .evergreen/run-search-index-test.sh
1009+
9561010
- name: test-x509-auth
9571011
commands:
9581012
- func: "bootstrap mongo-orchestration"

.evergreen/create-expansions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ PREPARE_SHELL: |
5555
export PROJECT_DIRECTORY="${PROJECT_DIRECTORY}"
5656
export MONGOCRYPT_LIB_DIR="${MONGOCRYPT_LIB_DIR}"
5757
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
58+
export INDEX_MANAGEMENT_TEST_UNIFIED=1
5859
5960
export TMPDIR="${TMPDIR}"
6061
export PATH="${PATH}"

.evergreen/run-search-index-test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
6+
source ./.evergreen/env.sh
7+
source .evergreen/cargo-test.sh
8+
9+
set -o xtrace
10+
11+
unset INDEX_MANAGEMENT_TEST_UNIFIED
12+
export INDEX_MANAGEMENT_TEST_PROSE=1
13+
14+
set +o errexit
15+
16+
cargo_test test::spec::index_management results.xml
17+
18+
exit ${CARGO_RESULT}

src/operation/search_index.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ impl OperationWithDefaults for UpdateSearchIndex {
107107

108108
fn handle_response(
109109
&self,
110-
response: crate::cmap::RawCommandResponse,
110+
_response: crate::cmap::RawCommandResponse,
111111
_description: &crate::cmap::StreamDescription,
112112
) -> crate::error::Result<Self::O> {
113-
response.body()
113+
Ok(())
114114
}
115115

116116
fn supports_sessions(&self) -> bool {
@@ -155,10 +155,10 @@ impl OperationWithDefaults for DropSearchIndex {
155155

156156
fn handle_response(
157157
&self,
158-
response: crate::cmap::RawCommandResponse,
158+
_response: crate::cmap::RawCommandResponse,
159159
_description: &crate::cmap::StreamDescription,
160160
) -> Result<Self::O> {
161-
response.body()
161+
Ok(())
162162
}
163163

164164
fn handle_error(&self, error: crate::error::Error) -> Result<Self::O> {

0 commit comments

Comments
 (0)