Skip to content

Commit

Permalink
BUILD: debug stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-shalev committed Sep 16, 2024
1 parent b0d3de4 commit 8072eee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 8 additions & 6 deletions buildlib/tools/coverity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,18 @@ run_coverity() {
fi
cov-analyze --jobs $parallel_jobs $COV_OPT --security --concurrency --dir $cov_build
nerrors=$(cov-format-errors --dir $cov_build | awk '/Processing [0-9]+ errors?/ { print $2 }')
rc=$(($rc+$nerrors))

if [ $nerrors -gt 0 ]; then
cov-format-errors --dir $cov_build --emacs-style
cov_error_log="$(echo -e "\n$(cov-format-errors --dir $cov_build --emacs-style)")"
if [ -d "$WORKSPACE/$cov_build_id" ]; then
rm -rf $WORKSPACE/$cov_build_id
fi
cp -ar $cov_build $WORKSPACE/$cov_build_id
echo "not ok 1 Coverity Detected $nerrors failures"
else
echo "ok 1 Coverity found no issues"
rm -rf $cov_build
fi
modules_for_coverity_unload
return $rc
return $nerrors
}

parse_args $*
Expand All @@ -135,4 +132,9 @@ else
cd "${ucx_build_dir}"
fi

run_coverity "$mode"
run_coverity "$mode" || {
set +x
azure_log_error "Coverity found $nerrors issues: $cov_error_log"
azure_log_error "To debug, rerun with: $0 $mode"
exit 1
}
14 changes: 14 additions & 0 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() {
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

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 Down

0 comments on commit 8072eee

Please sign in to comment.