From cc55879356591bccfaf0e60bb4ca5adbbc715de2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 17 Oct 2025 14:26:34 +0100 Subject: [PATCH] [Test] Fix AWK syntax error in integration test analysis Add default values for count variables to prevent division errors when jq returns empty results --- test/integration/scripts/integration-test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/scripts/integration-test.sh b/test/integration/scripts/integration-test.sh index bac73364e1..c362cc7f99 100755 --- a/test/integration/scripts/integration-test.sh +++ b/test/integration/scripts/integration-test.sh @@ -192,6 +192,11 @@ if [ "$TOTAL" -eq 0 ]; then exit 1 fi +# Ensure counts are numeric (default to 0 if empty) +FUZZY_COUNT=${FUZZY_COUNT:-0} +BAYES_SPAM_COUNT=${BAYES_SPAM_COUNT:-0} +BAYES_HAM_COUNT=${BAYES_HAM_COUNT:-0} + # Calculate percentages using awk FUZZY_RATE=$(awk "BEGIN {printf \"%.1f\", ($FUZZY_COUNT / $TOTAL) * 100}") BAYES_SPAM_RATE=$(awk "BEGIN {printf \"%.1f\", ($BAYES_SPAM_COUNT / $TOTAL) * 100}") -- 2.47.3