Skip to content

Commit d89111a

Browse files
authored
RUST-2281 Cache test binary for cross-topololgy tests (#1549)
1 parent 97b22c4 commit d89111a

File tree

15 files changed

+393
-131
lines changed

15 files changed

+393
-131
lines changed
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/features.sh
8+
9+
FEATURE_FLAGS+=("${STANDARD_FEATURES[@]}")
10+
11+
add_conditional_features
12+
13+
if [[ "$LIBMONGOCRYPT_OS" != "" ]]; then
14+
FEATURE_FLAGS+=("in-use-encryption" "azure-kms" "text-indexes-unstable" "aws-auth")
15+
.evergreen/install-dependencies.sh libmongocrypt
16+
fi
17+
18+
cargo nextest archive --workspace $(features_option) --archive-file nextest-archive.tar.zst

.evergreen/cargo-test.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
CARGO_OPTIONS=()
44
TEST_OPTIONS=()
5-
FEATURE_FLAGS=()
65
CARGO_RESULT=0
76

8-
join_by() {
9-
local IFS="$1"
10-
shift
11-
echo "$*"
12-
}
7+
. .evergreen/features.sh
8+
9+
if [[ -f nextest-archive.tar.zst ]]; then
10+
WORKSPACE_ROOT="$(pwd)"
11+
if [[ "Windows_NT" = "$OS" ]]; then
12+
WORKSPACE_ROOT="$(cygpath -w ${WORKSPACE_ROOT})"
13+
fi
14+
CARGO_OPTIONS+=("--archive-file" "nextest-archive.tar.zst" "--workspace-remap" "${WORKSPACE_ROOT}")
15+
fi
16+
1317

1418
cargo_test_options() {
15-
local FILTERED=()
16-
for FEAT in "${FEATURE_FLAGS[@]}"; do
17-
[[ "${FEAT}" != "" ]] && FILTERED+=("${FEAT}")
18-
done
19-
local FEATURE_OPTION=""
20-
if ((${#FILTERED[@]} != 0)); then
21-
FEATURE_OPTION="--features $(join_by , "${FILTERED[@]}")"
19+
FEATURES="$(features_option)"
20+
if [[ -f nextest-archive.tar.zst ]]; then
21+
# Feature flags are set when the archive is built
22+
FEATURES=""
2223
fi
23-
echo $1 ${CARGO_OPTIONS[@]} ${FEATURE_OPTION} -- ${TEST_OPTIONS[@]}
24+
echo $1 ${CARGO_OPTIONS[@]} "${FEATURES}" -- ${TEST_OPTIONS[@]}
2425
}
2526

2627
cargo_test() {

0 commit comments

Comments
 (0)