From f827d612f38abb572cd20bdf668b1fa1e45b7dff Mon Sep 17 00:00:00 2001 From: Michal Shalev Date: Wed, 11 Sep 2024 12:03:37 +0300 Subject: [PATCH 1/3] CI: improve test_jenkins.sh error reporting --- contrib/test_jenkins.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/contrib/test_jenkins.sh b/contrib/test_jenkins.sh index f788f30f94f..77ea9540646 100755 --- a/contrib/test_jenkins.sh +++ b/contrib/test_jenkins.sh @@ -1168,11 +1168,26 @@ then set_ucx_common_test_env if [[ "$PROTO_ENABLE" == "no" ]]; then - run_test_proto_disable + 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 + } elif [[ "$ASAN_CHECK" == "yes" ]]; then - run_asan_check + run_asan_check || { + set +x + azure_log_error "AddressSanitaizer check failed" + azure_log_error "To debug, rerun with: ASAN_CHECK=yes $0" + exit 1 + } elif [[ "$VALGRIND_CHECK" == "yes" ]]; then - run_valgrind_check + run_valgrind_check || { + set +x + azure_log_error "Valgrind test failed" + azure_log_error "To debug, rerun with: VALGRIND_CHECK=yes $0" + exit 1 + } else run_tests fi From 93c776dd069e95ed11bb83efba2db72f1c1589b9 Mon Sep 17 00:00:00 2001 From: Michal Shalev Date: Mon, 16 Sep 2024 15:50:47 +0300 Subject: [PATCH 2/3] CI: PR fixes --- contrib/test_jenkins.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/contrib/test_jenkins.sh b/contrib/test_jenkins.sh index 77ea9540646..e7c43473f8f 100755 --- a/contrib/test_jenkins.sh +++ b/contrib/test_jenkins.sh @@ -1119,7 +1119,19 @@ run_tests() { do_distributed_task 0 4 run_nt_buffer_transfer_tests } +error_handler() { + set +x + local exit_code=$? + local test_name="$1" + local flag="$2" + + 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 @@ -1130,6 +1142,7 @@ run_test_proto_disable() { } run_asan_check() { + trap 'error_handler "AddressSanitizer check" "ASAN_CHECK=yes"' ERR build devel --enable-gtest --enable-asan --without-valgrind if ! ldd ${WORKSPACE}/build-test/test/gtest/gtest | grep -q "libasan.so" @@ -1142,6 +1155,7 @@ run_asan_check() { } 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 @@ -1168,26 +1182,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 From 2247f2e188dfbf3d6050b067521b25e7ceac5df5 Mon Sep 17 00:00:00 2001 From: Michal Shalev Date: Tue, 8 Oct 2024 11:29:28 +0000 Subject: [PATCH 3/3] CI: PR fixes 2.0 --- contrib/test_jenkins.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/test_jenkins.sh b/contrib/test_jenkins.sh index e7c43473f8f..fa5a4e48b2a 100755 --- a/contrib/test_jenkins.sh +++ b/contrib/test_jenkins.sh @@ -1121,13 +1121,12 @@ run_tests() { error_handler() { set +x - local exit_code=$? local test_name="$1" local flag="$2" azure_log_error "$test_name failed" azure_log_error "To debug, rerun with: $flag $0" - exit $exit_code + exit 1 } run_test_proto_disable() {