Skip to content

Commit 5947cfd

Browse files
authored
RUST-1210 Expose test failures and compile failures (#592)
1 parent 98fb6eb commit 5947cfd

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.evergreen/run-async-std-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
set -o errexit
4+
set -o pipefail
45

56
source ./.evergreen/env.sh
67

@@ -12,11 +13,19 @@ fi
1213

1314
echo "cargo test options: ${OPTIONS}"
1415

16+
set +o errexit
17+
CARGO_RESULT=0
18+
1519
RUST_BACKTRACE=1 cargo test --no-default-features --features async-std-runtime $OPTIONS | tee async-tests.json
20+
(( CARGO_RESULT = CARGO_RESULT || $? ))
1621
cat async-tests.json | cargo2junit > async-tests.xml
1722
RUST_BACKTRACE=1 cargo test sync --no-default-features --features sync $OPTIONS | tee sync-tests.json
23+
(( CARGO_RESULT = CARGO_RESULT || $? ))
1824
cat sync-tests.json | cargo2junit > sync-tests.xml
1925
RUST_BACKTRACE=1 cargo test --doc sync --no-default-features --features sync $OPTIONS | tee sync-doc-tests.json
26+
(( CARGO_RESULT = CARGO_RESULT || $? ))
2027
cat sync-doc-tests.json | cargo2junit > sync-doc-tests.xml
2128

2229
junit-report-merger results.xml async-tests.xml sync-tests.xml sync-doc-tests.xml
30+
31+
exit $CARGO_RESULT

.evergreen/run-serverless-tests.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -o errexit
4+
set -o pipefail
45

56
source ./.evergreen/env.sh
67

@@ -23,12 +24,17 @@ fi
2324

2425
echo "cargo test options: ${DEFAULT_FEATURES} --features $FEATURE_FLAGS ${OPTIONS}"
2526

27+
CARGO_RESULT=0
28+
2629
cargo_test() {
2730
RUST_BACKTRACE=1 \
2831
SERVERLESS="serverless" \
2932
cargo test ${DEFAULT_FEATURES} --features $FEATURE_FLAGS $1 $OPTIONS | cargo2junit
33+
(( CARGO_RESULT = $CARGO_RESULT || $? ))
3034
}
3135

36+
set +o errexit
37+
3238
cargo_test test::spec::crud > crud.xml
3339
cargo_test test::spec::retryable_reads > retryable_reads.xml
3440
cargo_test test::spec::retryable_writes > retryable_writes.xml
@@ -38,4 +44,6 @@ cargo_test test::spec::transactions > transactions.xml
3844
cargo_test test::spec::load_balancers > load_balancers.xml
3945
cargo_test test::cursor > cursor.xml
4046

41-
junit-report-merger results.xml crud.xml retryable_reads.xml retryable_writes.xml versioned_api.xml sessions.xml transactions.xml load_balancers.xml cursor.xml
47+
junit-report-merger results.xml crud.xml retryable_reads.xml retryable_writes.xml versioned_api.xml sessions.xml transactions.xml load_balancers.xml cursor.xml
48+
49+
exit $CARGO_RESULT

.evergreen/run-tokio-tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@ FEATURE_FLAGS="zstd-compression,snappy-compression,zlib-compression"
1414

1515
echo "cargo test options: --features $FEATURE_FLAGS ${OPTIONS}"
1616

17+
set +o errexit
18+
CARGO_RESULT=0
19+
1720
RUST_BACKTRACE=1 cargo test --features $FEATURE_FLAGS $OPTIONS | tee results.json
21+
(( CARGO_RESULT = CARGO_RESULT || $? ))
1822
cat results.json | cargo2junit > async-tests.xml
1923
RUST_BACKTRACE=1 cargo test sync --features tokio-sync,$FEATURE_FLAGS $OPTIONS | tee sync-tests.json
24+
(( CARGO_RESULT = CARGO_RESULT || $? ))
2025
cat sync-tests.json | cargo2junit > sync-tests.xml
2126
RUST_BACKTRACE=1 cargo test --doc sync --features tokio-sync,$FEATURE_FLAGS $OPTIONS | tee sync-doc-tests.json
27+
(( CARGO_RESULT = CARGO_RESULT || $? ))
2228
cat sync-doc-tests.json | cargo2junit > sync-doc-tests.xml
2329

2430
junit-report-merger results.xml async-tests.xml sync-tests.xml sync-doc-tests.xml
31+
32+
exit $CARGO_RESULT

0 commit comments

Comments
 (0)