Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/skills/test-backend-coverage.SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ environment_variables:
description: "Minimum coverage percentage required (overrides default)"
default: "85"
required: false
- name: "CHARON_TEST_TIMEOUT"
description: "Per-package go test timeout passed as -timeout"
default: "30m"
required: false
- name: "CPM_MIN_COVERAGE"
description: "Alternative name for minimum coverage threshold (legacy)"
default: "85"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codecov-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
backend-codecov:
name: Backend Codecov Upload
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 30
if: ${{ github.event_name != 'workflow_dispatch' || inputs.run_backend }}
steps:
- name: Checkout
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
frontend-codecov:
name: Frontend Codecov Upload
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 25
if: ${{ github.event_name != 'workflow_dispatch' || inputs.run_frontend }}
steps:
- name: Checkout
Expand Down
7 changes: 5 additions & 2 deletions scripts/go-test-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BACKEND_DIR="$ROOT_DIR/backend"
COVERAGE_FILE="$BACKEND_DIR/coverage.txt"
MIN_COVERAGE="${CHARON_MIN_COVERAGE:-${CPM_MIN_COVERAGE:-87}}"
# Per-package `go test` timeout. Go's 10m default is too tight for the slowest
# packages (internal/services takes ~9.5m under -race on CI runners).
TEST_TIMEOUT="${CHARON_TEST_TIMEOUT:-30m}"

generate_test_encryption_key() {
if command -v openssl >/dev/null 2>&1; then
Expand Down Expand Up @@ -130,12 +133,12 @@ trap 'rm -f "$TEST_OUTPUT_FILE"' EXIT

if command -v gotestsum &> /dev/null; then
set +e
gotestsum --format pkgname -- -race -mod=readonly -coverprofile="$COVERAGE_FILE" ./... 2>&1 | tee "$TEST_OUTPUT_FILE"
gotestsum --format pkgname -- -race -timeout="$TEST_TIMEOUT" -mod=readonly -coverprofile="$COVERAGE_FILE" ./... 2>&1 | tee "$TEST_OUTPUT_FILE"
GO_TEST_STATUS=$?
set -e
else
set +e
go test -race -v -mod=readonly -coverprofile="$COVERAGE_FILE" ./... 2>&1 | tee "$TEST_OUTPUT_FILE"
go test -race -v -timeout="$TEST_TIMEOUT" -mod=readonly -coverprofile="$COVERAGE_FILE" ./... 2>&1 | tee "$TEST_OUTPUT_FILE"
GO_TEST_STATUS=$?
set -e
fi
Expand Down
Loading