diff --git a/scripts/cargo-test.sh b/scripts/cargo-test.sh index cf33aef933..cdfbd4b8c3 100755 --- a/scripts/cargo-test.sh +++ b/scripts/cargo-test.sh @@ -1,18 +1,19 @@ #!/usr/bin/env bash -SCRIPTDIR=$(dirname "$0") +SCRIPTDIR="$(realpath "$(dirname "$0")")" cleanup_handler() { - $SCRIPTDIR/clean-cargo-tests.sh || true + ERROR=$? + "$SCRIPTDIR"/clean-cargo-tests.sh || true + if [ $ERROR != 0 ]; then exit $ERROR; fi } -trap cleanup_handler ERR INT QUIT TERM HUP EXIT - echo "running cargo-test..." echo "rustc version:" rustc --version cleanup_handler +trap cleanup_handler INT QUIT TERM HUP EXIT set -euxo pipefail export PATH=$PATH:${HOME}/.cargo/bin diff --git a/scripts/grpc-test.sh b/scripts/grpc-test.sh index a865e90314..1f07c10137 100755 --- a/scripts/grpc-test.sh +++ b/scripts/grpc-test.sh @@ -1,19 +1,21 @@ #!/usr/bin/env bash -SCRIPTDIR=$(dirname "$0") -trap cleanup_handler ERR INT QUIT TERM HUP EXIT +SCRIPTDIR="$(realpath "$(dirname "$0")")" cleanup_handler() { - $SCRIPTDIR/clean-cargo-tests.sh || true + ERROR=$? + "$SCRIPTDIR"/clean-cargo-tests.sh || true + if [ $ERROR != 0 ]; then exit $ERROR; fi } +cleanup_handler +trap cleanup_handler INT QUIT TERM HUP EXIT + set -euxo pipefail export PATH="$PATH:${HOME}/.cargo/bin" export npm_config_jobs=$(nproc) -cleanup_handler - cargo build --all cd "$(dirname "$0")/../test/grpc" npm install --legacy-peer-deps