mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
5d93786995
- Update scripts/: start-dev, stop-dev, dev-setup, setup, setup-ovn, etc. - Update tests/e2e/: all E2E test scripts - Update scripts/iac/: rename hive-test.sh → spinifex-test.sh, update TF files - Update config/: rename hive.service and install script - Binary refs use spx, env vars use SPINIFEX_, paths use spinifex
21 lines
530 B
Bash
Executable File
21 lines
530 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Run Go tests with coverage and report total code coverage.
|
|
|
|
COVERPROFILE=$(mktemp /tmp/spinifex-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 ./spinifex/... 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 }'
|