ci: Save full logs for failed sanitized tests (#2715)

This commit is contained in:
Ayaz Salikhov
2025-10-23 17:06:02 +01:00
committed by GitHub
parent f41d574204
commit 1bfdd0dd89
3 changed files with 9 additions and 8 deletions

View File

@@ -31,15 +31,16 @@ TESTS=$($TEST_BINARY --gtest_list_tests | awk '/^ / {print suite $1} !/^ / {su
OUTPUT_DIR="./.sanitizer-report" OUTPUT_DIR="./.sanitizer-report"
mkdir -p "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR"
export TSAN_OPTIONS="die_after_fork=0"
export MallocNanoZone='0' # for MacOSX
for TEST in $TESTS; do for TEST in $TESTS; do
OUTPUT_FILE="$OUTPUT_DIR/${TEST//\//_}" OUTPUT_FILE="$OUTPUT_DIR/${TEST//\//_}.log"
export TSAN_OPTIONS="log_path=\"$OUTPUT_FILE\" die_after_fork=0" $TEST_BINARY --gtest_filter="$TEST" > "$OUTPUT_FILE" 2>&1
export ASAN_OPTIONS="log_path=\"$OUTPUT_FILE\""
export UBSAN_OPTIONS="log_path=\"$OUTPUT_FILE\""
export MallocNanoZone='0' # for MacOSX
$TEST_BINARY --gtest_filter="$TEST" > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "'$TEST' failed a sanitizer check." echo "'$TEST' failed a sanitizer check."
else
rm "$OUTPUT_FILE"
fi fi
done done

View File

@@ -68,7 +68,7 @@ jobs:
- name: Run clio_tests (sanitizer errors ignored) - name: Run clio_tests (sanitizer errors ignored)
if: ${{ env.SANITIZER_IGNORE_ERRORS == 'true' }} if: ${{ env.SANITIZER_IGNORE_ERRORS == 'true' }}
run: ./.github/scripts/execute-tests-under-sanitizer ./clio_tests run: ./.github/scripts/execute-tests-under-sanitizer.sh ./clio_tests
- name: Check for sanitizer report - name: Check for sanitizer report
if: ${{ env.SANITIZER_IGNORE_ERRORS == 'true' }} if: ${{ env.SANITIZER_IGNORE_ERRORS == 'true' }}

View File

@@ -15,7 +15,7 @@ on:
- ".github/actions/**" - ".github/actions/**"
- "!.github/actions/build-docker-image/**" - "!.github/actions/build-docker-image/**"
- "!.github/actions/create-issue/**" - "!.github/actions/create-issue/**"
- .github/scripts/execute-tests-under-sanitizer - .github/scripts/execute-tests-under-sanitizer.sh
- CMakeLists.txt - CMakeLists.txt
- conanfile.py - conanfile.py