Skip to content

Commit a1c7d46

Browse files
RUST-2055 Use cargo-nextest to filter CSFLE tests (#1306)
1 parent f093709 commit a1c7d46

File tree

10 files changed

+3627
-3631
lines changed

10 files changed

+3627
-3631
lines changed

.evergreen/config.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ buildvariants:
238238

239239
- name: gcp-kms
240240
display_name: "GCP KMS"
241-
patchable: false
241+
# patchable: false
242242
run_on:
243243
# The GCP CLI is not available on RHEL/Ubuntu machines.
244244
- debian11-small
@@ -1678,25 +1678,21 @@ functions:
16781678
echo "Untarring test contents ... end"
16791679
16801680
"run gcp kms test":
1681-
- command: shell.exec
1681+
- command: subprocess.exec
16821682
type: test
16831683
params:
1684-
working_dir: src
1685-
shell: bash
1686-
script: |
1687-
${PREPARE_SHELL}
1688-
1689-
set +o xtrace
1690-
export GCPKMS_GCLOUD=${GCPKMS_GCLOUD}
1691-
export GCPKMS_PROJECT=${GCPKMS_PROJECT}
1692-
export GCPKMS_ZONE=${GCPKMS_ZONE}
1693-
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
1694-
set -o xtrace
1695-
1696-
export GCPKMS_CMD="ON_DEMAND_GCP_CREDS_SHOULD_SUCCEED=1 \
1697-
RUST_BACKTRACE=1 LD_LIBRARY_PATH=./test-contents/lib \
1698-
./test-contents/test-exe on_demand_gcp_credentials --nocapture"
1699-
$DRIVERS_TOOLS/.evergreen/csfle/gcpkms/run-command.sh
1684+
working_dir: ${DRIVERS_TOOLS}
1685+
binary: bash
1686+
include_expansions_in_env:
1687+
- GCPKMS_GCLOUD
1688+
- GCPKMS_PROJECT
1689+
- GCPKMS_ZONE
1690+
- GCPKMS_INSTANCENAME
1691+
- DRIVERS_TOOLS
1692+
env:
1693+
GCPKMS_CMD: "RUST_BACKTRACE=1 LD_LIBRARY_PATH=./test-contents/lib ./test-contents/test-exe on_demand_gcp::success -- --no-capture"
1694+
args:
1695+
- .evergreen/csfle/gcpkms/run-command.sh
17001696

17011697
"assume ec2 role":
17021698
- command: ec2.assume_role

.evergreen/run-csfle-tests.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ set -o xtrace
1010

1111
export CSFLE_TLS_CERT_DIR="${DRIVERS_TOOLS}/.evergreen/x509gen"
1212

13-
FEATURE_FLAGS+=("in-use-encryption" "aws-auth" "azure-kms")
13+
FEATURE_FLAGS+=("in-use-encryption" "azure-kms")
14+
CARGO_OPTIONS+=("--ignore-default-filter")
1415

1516
if [[ "$OPENSSL" = true ]]; then
1617
FEATURE_FLAGS+=("openssl-tls")
@@ -32,9 +33,12 @@ set +o errexit
3233
cargo_test test::csfle
3334
cargo_test test::spec::client_side_encryption
3435

36+
FEATURE_FLAGS+=("aws-auth")
37+
cargo_test on_demand_aws::success
38+
3539
# Unset variables for on-demand credential failure tests.
3640
unset AWS_ACCESS_KEY_ID
3741
unset AWS_SECRET_ACCESS_KEY
38-
cargo_test test::csfle::on_demand_aws_failure
42+
cargo_test on_demand_aws::failure
3943

4044
exit ${CARGO_RESULT}

src/test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ mod coll;
1818
))]
1919
mod compression;
2020
#[cfg(feature = "in-use-encryption")]
21-
pub(crate) mod csfle;
21+
#[path = "test/csfle.rs"]
22+
pub(crate) mod csfle_skip_local; // see modules for requirements
2223
mod cursor;
2324
mod db;
2425
mod documentation_examples;
@@ -30,6 +31,8 @@ pub(crate) mod spec;
3031
mod timeseries;
3132
pub(crate) mod util;
3233

34+
#[cfg(feature = "in-use-encryption")]
35+
pub(crate) use self::csfle_skip_local as csfle;
3336
pub(crate) use self::{
3437
spec::{run_spec_test, RunOn, Serverless, Topology},
3538
util::{

0 commit comments

Comments
 (0)