Skip to content

Commit

Permalink
CI: PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-shalev committed Sep 16, 2024
1 parent d8b8b97 commit 8fcfcd1
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions contrib/test_jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,19 @@ run_tests() {
do_distributed_task 0 4 run_nt_buffer_transfer_tests
}

error_handler() {
local exit_code=$?
local test_name="$1"
local flag="$2"

set +x
azure_log_error "$test_name failed"
azure_log_error "To debug, rerun with: $flag $0"
exit $exit_code
}

run_test_proto_disable() {
trap 'error_handler "Proto V1 test" "PROTO_ENABLE=no"' ERR
# build for devel tests and gtest
build devel --enable-gtest

Expand All @@ -1130,11 +1142,13 @@ run_test_proto_disable() {
}

run_asan_check() {
trap 'error_handler "AddressSanitizer check" "ASAN_CHECK=yes"' ERR
build devel --enable-gtest --enable-asan --without-valgrind
run_gtest "default"
}

run_valgrind_check() {
trap 'error_handler "Valgrind check" "VALGRIND_CHECK=yes"' ERR
if [[ $(uname -m) =~ "aarch" ]] || [[ $(uname -m) =~ "ppc" ]]; then
echo "==== Skip valgrind tests on `uname -m` ===="
return
Expand All @@ -1161,26 +1175,11 @@ then
set_ucx_common_test_env

if [[ "$PROTO_ENABLE" == "no" ]]; then
run_test_proto_disable || {
set +x
azure_log_error "Proto V1 test failed"
azure_log_error "To debug, rerun with: PROTO_ENABLE=no $0"
exit 1
}
run_test_proto_disable
elif [[ "$ASAN_CHECK" == "yes" ]]; then
run_asan_check || {
set +x
azure_log_error "AddressSanitaizer check failed"
azure_log_error "To debug, rerun with: ASAN_CHECK=yes $0"
exit 1
}
run_asan_check
elif [[ "$VALGRIND_CHECK" == "yes" ]]; then
run_valgrind_check || {
set +x
azure_log_error "Valgrind test failed"
azure_log_error "To debug, rerun with: VALGRIND_CHECK=yes $0"
exit 1
}
run_valgrind_check
else
run_tests
fi
Expand Down

0 comments on commit 8fcfcd1

Please sign in to comment.