Skip to content

Commit 0deb71f

Browse files
RUST-2055 Use cargo-nextest to filter tests (#1303)
1 parent 3de1b74 commit 0deb71f

23 files changed

+277
-368
lines changed

.config/nextest.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[profile.default]
22
test-threads = 1
3-
default-filter = 'not test(test::happy_eyeballs) and not test(kms_retry)'
3+
default-filter = 'not test(skip_local) and not test(skip_ci)'
44

55
[profile.ci]
66
failure-output = "final"
77
test-threads = 1
88
fail-fast = false
9-
default-filter = 'not test(test::happy_eyeballs)'
9+
default-filter = 'not test(skip_ci)'
1010

1111
[profile.ci.junit]
12-
path = "junit.xml"
12+
path = "junit.xml"

.evergreen/build-static-test-tarball.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ set -o pipefail
66
source ./.evergreen/env.sh
77

88
export RUSTFLAGS="-C target-feature=+crt-static"
9-
cargo test ${BUILD_FEATURES} --target x86_64-unknown-linux-gnu get_exe_name -- --ignored
9+
cargo test ${BUILD_FEATURES} --target x86_64-unknown-linux-gnu get_exe_name
1010
TEST_BINARY=$(cat exe_name.txt)
1111
TEST_TARBALL="/tmp/mongo-rust-driver.tar.gz"
1212
tar czvf ${TEST_TARBALL} ${TEST_BINARY} ./.evergreen
1313

1414
cat <<EOT > static-test-tarball-expansion.yml
1515
STATIC_TEST_BINARY: ${TEST_BINARY}
1616
STATIC_TEST_TARBALL: ${TEST_TARBALL}
17-
EOT
17+
EOT

.evergreen/config.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,6 @@ buildvariants:
260260
tasks:
261261
- name: test-x509-auth
262262

263-
- name: plain-auth
264-
display_name: "Plain Authentication"
265-
patchable: false
266-
run_on:
267-
- rhel87-small
268-
expansions:
269-
AUTH: auth
270-
SSL: ssl
271-
tasks:
272-
- test-plain-auth
273-
274263
- name: serverless
275264
display_name: "Serverless"
276265
run_on:
@@ -972,14 +961,6 @@ tasks:
972961
TOPOLOGY: server
973962
- func: "run x509 tests"
974963

975-
- name: test-plain-auth
976-
commands:
977-
- func: "bootstrap mongo-orchestration"
978-
vars:
979-
MONGODB_VERSION: rapid
980-
TOPOLOGY: server
981-
- func: "run plain tests"
982-
983964
- name: test-serverless
984965
commands:
985966
- func: "run serverless tests"
@@ -1417,17 +1398,6 @@ functions:
14171398
14181399
.evergreen/run-x509-tests.sh
14191400
1420-
"run plain tests":
1421-
- command: shell.exec
1422-
type: test
1423-
params:
1424-
working_dir: src
1425-
shell: bash
1426-
script: |
1427-
${PREPARE_SHELL}
1428-
1429-
.evergreen/run-plain-tests.sh
1430-
14311401
"prepare resources":
14321402
- command: subprocess.exec
14331403
params:
@@ -1694,7 +1664,7 @@ functions:
16941664
16951665
echo "Building test ... begin"
16961666
. ${PROJECT_DIRECTORY}/.evergreen/env.sh
1697-
cargo test get_exe_name --features in-use-encryption,gcp-kms -- --ignored
1667+
cargo test get_exe_name --features in-use-encryption,gcp-kms
16981668
cp $(cat exe_name.txt) test-contents/test-exe
16991669
echo "Building test ... end"
17001670
@@ -1963,7 +1933,7 @@ functions:
19631933
- command: expansions.update
19641934
params:
19651935
file: src/static-test-tarball-expansion.yml
1966-
1936+
19671937
"run oidc k8s test":
19681938
- command: subprocess.exec
19691939
params:

.evergreen/run-atlas-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ set -o pipefail
66
source .evergreen/env.sh
77
source .evergreen/cargo-test.sh
88

9-
export MONGO_ATLAS_TESTS=1
9+
CARGO_OPTIONS+=("--ignore-default-filter")
1010

1111
source "${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh" drivers/atlas_connect
1212

1313
set +o errexit
1414

15-
cargo_test atlas_connectivity
15+
cargo_test test::atlas_connectivity
1616

1717
exit $CARGO_RESULT

.evergreen/run-aws-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FEATURE_FLAGS+=("aws-auth")
1818

1919
set +o errexit
2020

21-
cargo_test auth_aws
21+
cargo_test test::auth::aws
2222
cargo_test lambda_examples::auth::test_handler
2323
cargo_test spec::auth
2424
cargo_test uri_options

.evergreen/run-connection-string-tests.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

.evergreen/run-plain-tests.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ set -o pipefail
66
source ./.evergreen/env.sh
77
source .evergreen/cargo-test.sh
88

9-
set -o xtrace
9+
CARGO_OPTIONS+=("--ignore-default-filter")
1010

11-
unset INDEX_MANAGEMENT_TEST_UNIFIED
12-
export INDEX_MANAGEMENT_TEST_PROSE=1
11+
set -o xtrace
1312

1413
set +o errexit
1514

16-
cargo_test test::spec::index_management
15+
cargo_test test::index_management::search_index
1716

18-
exit ${CARGO_RESULT}
17+
exit ${CARGO_RESULT}

.evergreen/run-tests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ if [ "$SNAPPY" = true ]; then
2424
FEATURE_FLAGS+=("snappy-compression")
2525
fi
2626

27-
export SESSION_TEST_REQUIRE_MONGOCRYPTD=true
28-
export INDEX_MANAGEMENT_TEST_UNIFIED=1
29-
3027
echo "cargo test options: $(cargo_test_options)"
3128

3229
set +o errexit

src/test.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#![allow(clippy::cast_possible_wrap)]
33

44
#[cfg(feature = "dns-resolver")]
5-
mod atlas_connectivity;
6-
mod atlas_planned_maintenance_testing;
7-
#[cfg(feature = "aws-auth")]
8-
mod auth_aws;
5+
#[path = "test/atlas_connectivity.rs"]
6+
mod atlas_connectivity_skip_ci; // requires Atlas URI environment variables set
7+
#[path = "test/atlas_planned_maintenance_testing.rs"]
8+
mod atlas_planned_maintenance_testing_skip_ci; // run from the drivers-atlas-testing project
9+
mod auth;
910
mod bulk_write;
1011
mod change_stream;
1112
mod client;
@@ -21,7 +22,8 @@ pub(crate) mod csfle;
2122
mod cursor;
2223
mod db;
2324
mod documentation_examples;
24-
mod happy_eyeballs;
25+
#[path = "test/happy_eyeballs.rs"]
26+
mod happy_eyeballs_skip_ci; // requires happy eyeballs server
2527
mod index_management;
2628
mod lambda_examples;
2729
pub(crate) mod spec;

0 commit comments

Comments
 (0)