From 6de0973ef011a43fe4b2a62f1761bc00eb7e538f Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Wed, 10 Sep 2025 10:30:13 -0400 Subject: [PATCH] sync: update 4 files from source repository --- .github/.env.base | 2 +- .github/actions/test-failure-detection/action.yml | 9 ++++++--- .github/workflows/fortress-release.yml | 1 + .github/workflows/fortress-test-matrix.yml | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/.env.base b/.github/.env.base index 9784a54..e1f9efd 100644 --- a/.github/.env.base +++ b/.github/.env.base @@ -260,7 +260,7 @@ NANCY_EXCLUDES=CVE-2024-38513,CVE-2023-45142 # ================================================================================================ # Pre-Commit System -GO_PRE_COMMIT_VERSION=v1.1.15 # https://github.com/mrz1836/go-pre-commit +GO_PRE_COMMIT_VERSION=v1.1.16 # https://github.com/mrz1836/go-pre-commit GO_PRE_COMMIT_USE_LOCAL=false # Use local version for development # System Settings diff --git a/.github/actions/test-failure-detection/action.yml b/.github/actions/test-failure-detection/action.yml index 4504c4d..d0747ae 100644 --- a/.github/actions/test-failure-detection/action.yml +++ b/.github/actions/test-failure-detection/action.yml @@ -119,24 +119,27 @@ runs: # Initialize JSON array for structured failures with signatures echo '[]' > "$signatures_file" + # Define common test validation filter to avoid duplication + local test_failure_filter='select(.Action == "fail" and .Test != null and .Test != "" and .Test != "null" and (.Test | test("^Test[A-Za-z]")))' + # Fast single-pass JSON extraction for test failures (< 1s for 10K lines) # Filter JSON lines and parse in one pass - eliminates 2-minute hang # Note: Line numbers aren't available in Go test JSON output # IMPORTANT: Only detect actual test function failures, not package/suite completion events grep '^{' "$json_file" 2>/dev/null | \ - jq -r 'select(.Action == "fail" and .Test != null and .Test != "" and .Test != "null" and (.Test | test("^Test[A-Za-z]"))) | + jq -r "$test_failure_filter"' | "--- FAIL: \(.Test) (\(.Package))"' \ 2>/dev/null > "$failures_file" # Create structured test failure entries with unique signatures - if grep '^{' "$json_file" 2>/dev/null | jq -r 'select(.Action == "fail" and .Test != null and .Test != "" and .Test != "null" and (.Test | test("^Test[A-Za-z]")))' 2>/dev/null | head -1 | grep -q .; then + if grep '^{' "$json_file" 2>/dev/null | jq -r "$test_failure_filter" 2>/dev/null | head -1 | grep -q .; then echo "📝 Creating structured test failure entries with enhanced output..." # First pass: Extract test failure basic info from Action == "fail" entries local temp_failures temp_failures=$(mktemp) grep '^{' "$json_file" 2>/dev/null | \ - jq -r 'select(.Action == "fail" and .Test != null and .Test != "" and .Test != "null" and (.Test | test("^Test[A-Za-z]"))) | { + jq -r "$test_failure_filter"' | { type: "test", package: .Package, test: (if (.Test and .Test != null and .Test != "null") then .Test else "unknown" end), diff --git a/.github/workflows/fortress-release.yml b/.github/workflows/fortress-release.yml index 6d5b039..d49cf2b 100644 --- a/.github/workflows/fortress-release.yml +++ b/.github/workflows/fortress-release.yml @@ -269,6 +269,7 @@ jobs: id: goreleaser env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SKIP_GORELEASER_TESTS: "true" run: | echo "🚀 Building and publishing release with GoReleaser..." diff --git a/.github/workflows/fortress-test-matrix.yml b/.github/workflows/fortress-test-matrix.yml index 00e335a..93ec415 100644 --- a/.github/workflows/fortress-test-matrix.yml +++ b/.github/workflows/fortress-test-matrix.yml @@ -264,7 +264,7 @@ jobs: # Count ONLY failed test events, not package/suite failures which are expected # Look for Action="fail" AND Package field AND Test field (indicating actual test failure) JSON_FAILURES=$(grep '^{' test-output.log 2>/dev/null | \ - jq -r 'select(.Action == "fail" and .Test != null and .Test != "" and (.Package // "") != "" and (.Test | test("^Test[A-Z]"))) | .Test' 2>/dev/null | wc -l | xargs || echo "0") + jq -r 'select(.Action == "fail" and .Test != null and .Test != "" and (.Package // "") != "" and (.Test | test("^Test[A-Za-z]"))) | .Test' 2>/dev/null | wc -l | xargs || echo "0") if [[ $JSON_FAILURES -gt 0 ]]; then echo "⚠️ Found $JSON_FAILURES actual failing test functions in JSON output"