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
2 changes: 1 addition & 1 deletion .github/.env.base
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions .github/actions/test-failure-detection/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/fortress-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fortress-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down