Something went wrong. Try again.
Webhook-to-SSE gateway with hierarchical topic routing and signature verification
Something went wrong. Try again.
1234567891011121314151617181920#!/bin/bashset -euo pipefail
THRESHOLD="${1:-100}"PROFILE=$(mktemp)trap 'rm -f "$PROFILE"' EXIT
# RACE is -race where a C compiler exists, and empty in CI.go test ${RACE:-} -coverprofile="$PROFILE" -covermode=atomic ./...
# Exclude main.go from coverage calculation (entrypoint, not unit-testable)COVERAGE=$(grep -v "main\.go:" "$PROFILE" | go tool cover -func=/dev/stdin | grep ^total: | awk '{print $3}' | tr -d '%')
if awk "BEGIN{exit(!($COVERAGE < $THRESHOLD))}"; then echo "FAIL: coverage ${COVERAGE}% is below ${THRESHOLD}%" exit 1fi
echo "OK: coverage ${COVERAGE}% meets ${THRESHOLD}% threshold"