Skip to content

Commit 51df6e1

Browse files
author
Peter Amiri
committed
ci: compat-matrix safe-slice hardening for #3302
Three workflow-plumbing fixes in compat-matrix.yml, shippable before the continue-on-error flip (which stays gated on PR #3365 merging plus one green dispatch on develop): - run-tests: per-leg zero-test guard — an HTTP 200/417 leg reporting totalSpecs below 4000 (suite runs ~4,700) now emits ::error:: and sets the leg fail flag, so a compile-wiped leg fails loudly instead of rendering as a pass. SOFT_FAIL_DBS is respected. - publish-results: fail_on: nothing on publish-unit-test-result-action, so oracle soft-fail debt stops pinning a red aggregate 'Wheels Test Results' check to innocent dispatch SHAs. Annotations, PR comments and artifacts are unchanged; leg gating stays in the tests job. - test-matrix-summary: zero-test legs render as ':warning: N tests' instead of a checkmark, soft-fail DB failures render as :warning:, and the Oracle column is annotated as soft-fail with a footnote. The rustcfml job is untouched (intentionally informational). Refs #3302 Signed-off-by: Peter Amiri <petera@pai.com>
1 parent 8bc8304 commit 51df6e1

1 file changed

Lines changed: 61 additions & 10 deletions

File tree

.github/workflows/compat-matrix.yml

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,40 @@ jobs:
439439
" || { echo "JUnit conversion failed for ${db} (non-fatal)"; rm -f "$JUNIT_FILE"; }
440440
fi
441441
442+
# Zero-test guard (#3302): a compile-wiped leg returns HTTP 200 with
443+
# totalSpecs=0 (one bad CFC zeroes the whole directory compile), which
444+
# previously rendered as a pass. Every engine runs the same core suite
445+
# (~4,700 specs), so anything below the floor means the suite never
446+
# actually ran. Revisit the floor if per-DB spec subsets ever ship.
447+
MIN_SPECS=4000
448+
TOTAL_SPECS="-1"
449+
if [ -f "$RESULT_FILE" ] && { [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "417" ]; }; then
450+
TOTAL_SPECS=$(python3 -c "
451+
import json, sys
452+
try:
453+
d = json.load(open('$RESULT_FILE'))
454+
print(int(d.get('totalSpecs', 0)))
455+
except:
456+
print(-1)
457+
" 2>/dev/null || echo "-1")
458+
fi
459+
460+
SPECS_OK=true
461+
if { [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "417" ]; } && [ "$TOTAL_SPECS" -lt "$MIN_SPECS" ]; then
462+
SPECS_OK=false
463+
echo "::error::${{ matrix.cfengine }} + ${db}: HTTP ${HTTP_CODE} but only ${TOTAL_SPECS} testcases reported (floor: ${MIN_SPECS}) — suite likely compile-wiped, treating leg as failed"
464+
fi
465+
442466
# Track per-database result
443-
if [ "$HTTP_CODE" = "200" ]; then
444-
echo "PASSED: ${{ matrix.cfengine }} + ${db}"
467+
if [ "$HTTP_CODE" = "200" ] && [ "$SPECS_OK" = true ]; then
468+
echo "PASSED: ${{ matrix.cfengine }} + ${db} (${TOTAL_SPECS} testcases)"
445469
DB_STATUS="pass"
446470
else
447-
echo "FAILED: ${{ matrix.cfengine }} + ${db} (HTTP ${HTTP_CODE})"
471+
if [ "$HTTP_CODE" = "200" ]; then
472+
echo "FAILED: ${{ matrix.cfengine }} + ${db} (HTTP 200 but zero-test guard tripped)"
473+
else
474+
echo "FAILED: ${{ matrix.cfengine }} + ${db} (HTTP ${HTTP_CODE})"
475+
fi
448476
DB_STATUS="fail"
449477
if echo "$SOFT_FAIL_DBS" | grep -qw "$db"; then
450478
echo "::warning::${db} tests failed but marked as soft-fail (non-blocking)"
@@ -613,6 +641,12 @@ jobs:
613641
files: junit-results/**/*.xml
614642
check_name: "Wheels Test Results"
615643
comment_title: "Wheels Test Results"
644+
# Keep the aggregate check neutral (#3302): oracle soft-fail debt
645+
# otherwise pins a red "Wheels Test Results" check to whatever SHA
646+
# the matrix was dispatched on, marking innocent PRs UNSTABLE.
647+
# Leg pass/fail gating lives in the tests job (OVERALL_STATUS);
648+
# annotations, PR comments, and artifacts are unaffected by this.
649+
fail_on: nothing
616650
report_individual_runs: true
617651
report_suite_logs: any
618652
json_file: junit-results/test-results.json
@@ -647,27 +681,41 @@ jobs:
647681
MATRIX_MD="${MATRIX_MD}
648682
"
649683
MATRIX_MD="${MATRIX_MD}
650-
| Engine | MySQL | PostgreSQL | SQL Server | H2 | CockroachDB | Oracle | SQLite |"
684+
| Engine | MySQL | PostgreSQL | SQL Server | H2 | CockroachDB | Oracle (soft-fail) | SQLite |"
651685
MATRIX_MD="${MATRIX_MD}
652-
|--------|:-----:|:----------:|:----------:|:--:|:-----------:|:------:|:------:|"
686+
|--------|:-----:|:----------:|:----------:|:--:|:-----------:|:------------------:|:------:|"
687+
688+
# Keep in sync with SOFT_FAIL_DBS and MIN_SPECS in the tests job (#3302).
689+
SOFT_FAIL_DBS="oracle"
690+
MIN_SPECS=4000
653691
654692
for engine in lucee6 lucee7 adobe2023 adobe2025 boxlang; do
655693
ROW="| **${engine}** |"
656694
for db in mysql postgres sqlserver h2 cockroachdb oracle sqlite; do
657695
FILE="results/test-results-${engine}/${engine}-${db}-result.txt"
696+
IS_SOFT_FAIL=false
697+
if echo "$SOFT_FAIL_DBS" | grep -qw "$db"; then
698+
IS_SOFT_FAIL=true
699+
fi
658700
if [ -f "$FILE" ]; then
659-
FAIL=$(python3 -c "
701+
STATS=$(python3 -c "
660702
import json, sys
661703
try:
662704
d = json.load(open('$FILE'))
663-
print(int(d.get('totalFail', 0) + d.get('totalError', 0)))
705+
print(int(d.get('totalFail', 0) + d.get('totalError', 0)), int(d.get('totalSpecs', 0)))
664706
except:
665-
print(-1)
666-
" 2>/dev/null || echo "-1")
667-
if [ "$FAIL" = "0" ]; then
707+
print(-1, -1)
708+
" 2>/dev/null || echo "-1 -1")
709+
FAIL="${STATS% *}"
710+
SPECS="${STATS#* }"
711+
if [ "$FAIL" = "0" ] && [ "$SPECS" -ge "$MIN_SPECS" ]; then
668712
ROW="${ROW} :white_check_mark: |"
669713
elif [ "$FAIL" = "-1" ]; then
670714
ROW="${ROW} :warning: |"
715+
elif [ "$FAIL" = "0" ]; then
716+
ROW="${ROW} :warning: ${SPECS} tests |"
717+
elif [ "$IS_SOFT_FAIL" = true ]; then
718+
ROW="${ROW} :warning: ${FAIL} |"
671719
else
672720
ROW="${ROW} :x: ${FAIL} |"
673721
fi
@@ -681,6 +729,9 @@ jobs:
681729
682730
MATRIX_MD="${MATRIX_MD}
683731
732+
*Oracle is soft-fail (non-blocking, tracked in #2663) — :warning: cells in that column never gate the run.*
733+
*A ':warning: N tests' cell means the leg reported fewer than ${MIN_SPECS} testcases (suite likely compile-wiped, counted as failed).*
734+
684735
*Results for commit ${GITHUB_SHA:0:7}.*"
685736
686737
# Write to step summary

0 commit comments

Comments
 (0)