Skip to content

Commit 8fd9a6c

Browse files
committed
Fix run-tests script
Updates the script to exit on the first test failure Change-type: patch
1 parent 2a0bb28 commit 8fd9a6c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

examples/run-tests.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ set -e
55
RUST_LOG="${RUST_LOG:-debug}"
66
export RUST_LOG="${RUST_LOG},bollard=off,hyper=off"
77

8-
# Run the tests inside every directory with
9-
# a Cargo.tom
10-
find ./examples -name 'Cargo.toml' -exec sh -c '
11-
dir=$(dirname "$1")
8+
# Run the tests inside every directory with a Cargo.toml
9+
find ./examples -name 'Cargo.toml' | while read -r file; do
10+
dir=$(dirname "$file")
1211
echo "Running tests in $dir"
13-
(cd "$dir" && cargo test -- --test-threads 1)
14-
' sh {} \;
12+
(cd "$dir" && cargo test -- --test-threads 1) || {
13+
echo "Tests failed in $dir"
14+
exit 1
15+
}
16+
done

0 commit comments

Comments
 (0)