Skip to content

Commit 2b35455

Browse files
RUST-2055 Filter remaining tests with cargo-nextest (#1311)
1 parent 828c5ac commit 2b35455

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

.evergreen/run-csfle-tests.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ PATH=${PATH}:${DRIVERS_TOOLS}/mongodb/bin
3131
set +o errexit
3232

3333
cargo_test test::csfle
34-
cargo_test test::spec::client_side_encryption
3534

3635
FEATURE_FLAGS+=("aws-auth")
3736
cargo_test on_demand_aws::success

.evergreen/run-x509-tests.sh

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

10+
CARGO_OPTIONS+=("--ignore-default-filter")
11+
1012
export SUBJECT=$(openssl x509 -subject -nameopt RFC2253 -noout -inform PEM -in $CERT_PATH)
1113

1214
# Strip `subject=` prefix from the subject

src/test/client.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,8 @@ async fn saslprep() {
564564

565565
#[tokio::test]
566566
#[function_name::named]
567-
async fn x509_auth() {
568-
let username = match std::env::var("MONGO_X509_USER") {
569-
Ok(user) => user,
570-
Err(_) => return,
571-
};
567+
async fn x509_auth_skip_ci() {
568+
let username = std::env::var("MONGO_X509_USER").expect("MONGO_X509_USER");
572569

573570
let client = Client::for_test().await;
574571
let drop_user_result = client

src/test/csfle.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ mod on_demand_aws; // requires AWS credentials to be set or unset
1515
mod on_demand_gcp; // requires GCP
1616
#[path = "csfle/prose.rs"]
1717
mod prose; // requires environment variables listed below
18+
#[path = "csfle/spec.rs"]
19+
mod spec; // requires environment variables listed below
1820

1921
use std::{env, path::PathBuf};
2022

File renamed without changes.

src/test/spec.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
mod auth;
22
mod change_streams;
3-
#[cfg(feature = "in-use-encryption")]
4-
mod client_side_encryption;
53
mod collection_management;
64
mod command_monitoring;
75
mod connection_stepdown;
@@ -23,7 +21,7 @@ mod sessions;
2321
mod trace;
2422
mod transactions;
2523
pub(crate) mod unified_runner;
26-
mod v2_runner;
24+
pub(crate) mod v2_runner;
2725
mod versioned_api;
2826
mod write_error;
2927

src/test/spec/crud.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::test::spec::unified_runner::run_unified_tests;
1+
use crate::test::{spec::unified_runner::run_unified_tests, SERVERLESS};
22

33
#[tokio::test(flavor = "multi_thread")]
44
async fn run_unified() {
@@ -41,7 +41,7 @@ async fn run_unified() {
4141
"Database-level aggregate with $merge omits read preference for pre-5.0 server",
4242
];
4343
// TODO: remove this manual skip when this test is fixed to skip on serverless
44-
if std::env::var("SERVERLESS").is_ok() {
44+
if *SERVERLESS {
4545
skipped_tests.push("inserting _id with type null via clientBulkWrite");
4646
}
4747

src/test/spec/unified_runner/test_file.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ impl RunOnRequirement {
144144
return Err("requires auth".to_string());
145145
}
146146
}
147-
if let Some(csfle) = &self.csfle {
148-
if *csfle && std::env::var("CSFLE_LOCAL_KEY").is_err() {
149-
return Err("requires csfle env".to_string());
150-
}
147+
if self.csfle == Some(true) && !cfg!(feature = "in-use-encryption") {
148+
return Err("requires csfle but in-use-encryption feature not enabled".to_string());
151149
}
152150
Ok(())
153151
}

0 commit comments

Comments
 (0)