summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorCYFS <[email protected]>2026-06-26 13:15:02 +0800
committerRbb666 <[email protected]>2026-06-26 15:42:14 +0800
commitc374e529c4e04b31cb4505f57f7abd217e6b62ae (patch)
treec98e5c6422c8affdc9529c55d911433186d10989 /.github/workflows
parentbdae0ef2a311aba69be6d7c5afe70d7903e42d0d (diff)
ci: detect qemu utest assertions
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/utest_auto_run.yml27
1 files changed, 24 insertions, 3 deletions
diff --git a/.github/workflows/utest_auto_run.yml b/.github/workflows/utest_auto_run.yml
index 9dccc03dd7..09aecd8daf 100644
--- a/.github/workflows/utest_auto_run.yml
+++ b/.github/workflows/utest_auto_run.yml
@@ -358,23 +358,39 @@ jobs:
if: ${{ env.TOOLCHAIN_INSTALLED != '' && success() }}
timeout-minutes: 20
run: |
+ LOG_FILE="qemu_output_${TEST_QEMU_ARCH}.log"
FAILURE_DETECTED=false
ERROR_LOGS=""
export FAILURE_DETECTED ERROR_LOGS
+
+ if [[ ! -f "$LOG_FILE" ]]; then
+ echo "Error: QEMU log file $LOG_FILE was not created."
+ exit 1
+ fi
echo "=========================================================================================="
echo " || || "
echo " || Start automatic running of Utest || "
echo " VV VV "
echo "=========================================================================================="
+ set +e
timeout 20m bash -c '
- tail -n 0 -f "qemu_output_${TEST_QEMU_ARCH}.log" | while IFS= read -r line; do
+ tail -n +1 -f "$1" | while IFS= read -r line; do
echo "$line"
if [[ "$line" == *"[ FAILED ] [ result ]"* ]]; then
ERROR_LOGS="${ERROR_LOGS}${line}"$'\''\n'\''
FAILURE_DETECTED=true
fi
+ if [[ "${line,,}" == *"assertion failed"* || "${line,,}" == *"assert failed"* ]]; then
+ echo "=========================================================================================="
+ echo " || || "
+ echo " || Error: Assertion failure detected in QEMU log. || "
+ echo " VV VV "
+ echo "=========================================================================================="
+ exit 1
+ fi
+
if [[ "$line" == *"[==========] [ utest ] finished"* ]]; then
if [[ "$FAILURE_DETECTED" == "true" ]]; then
echo "=========================================================================================="
@@ -388,11 +404,12 @@ jobs:
echo "=========================================================================================="
echo " Successed: Utest run completed. Exiting log monitoring "
echo "=========================================================================================="
- break
+ exit 0
fi
done
- '
+ ' bash "$LOG_FILE"
monitor_status=$?
+ set -e
if [[ $monitor_status -eq 124 ]]; then
echo "=========================================================================================="
@@ -404,6 +421,10 @@ jobs:
exit 1
fi
+ if [[ $monitor_status -ne 0 ]]; then
+ pkill -f "qemu-system-${TEST_QEMU_ARCH}.*${TEST_BSP_ROOT}/rtthread.bin" || true
+ fi
+
exit $monitor_status
# # Post CI status to PR comment
# post-ci-status: