chore: more gateway tests

This commit is contained in:
Julian Sommer
2026-02-11 12:24:00 +10:00
parent 2d30743ba5
commit 467eb0252d
8 changed files with 1126 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
# Run Go tests with coverage and report total code coverage.
COVERPROFILE=$(mktemp /tmp/hive-coverage-XXXXXX.out)
trap 'rm -f "$COVERPROFILE"' EXIT
echo "Running tests with coverage..."
echo ""
LOG_IGNORE=1 go test -timeout 120s -coverprofile="$COVERPROFILE" -covermode=atomic ./hive/... 2>&1
if [[ ! -s "$COVERPROFILE" ]]; then
echo "No coverage data collected."
exit 1
fi
echo ""
echo "=== Total ==="
go tool cover -func="$COVERPROFILE" | awk '/^total:/ { print $NF }'