Skip to content

Commit b2838b6

Browse files
committed
improve result checking
1 parent 36861ff commit b2838b6

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

.github/workflows/unittest.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,13 @@ jobs:
126126
ci/run_conditional_tests.sh "${subdirs[@]}"
127127
128128
- name: Save Cell Status Footprint
129-
# Captures the real raw execution outcome ('success' or 'failure')
130-
# from the testing step and logs it to a text file for isolated verification.
129+
# Captures the execution outcome ('success' or 'failure') from the testing step.
131130
run: |
132131
mkdir -p footprints
133132
echo "${{ steps.run-tests.outcome }}" > footprints/status.txt
134133
135134
- name: Upload Status Footprint
136-
# Uploads the captured footprint text file. This creates a traceable
137-
# run record for each specific Python matrix variant and batch slice.
135+
# Uploads the footprint file to serve as a status record for this batch run.
138136
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
139137
with:
140138
name: footprint-${{ matrix.python }}-${{ matrix.batch-index }}
@@ -274,22 +272,25 @@ jobs:
274272
runs-on: ubuntu-latest
275273
steps:
276274
- name: Download Python-Specific Footprints
277-
# Downloads *only* the status footprints matching the specific Python matrix
278-
# version of this cell. This isolates runtime failure detection to prevent a failure in one
279-
# Python track (e.g. 3.14) from falsely blocking status gates on passing tracks (e.g. 3.10).
275+
# Downloads only the status footprints matching the specific Python version of this cell.
280276
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
281277
with:
282278
pattern: footprint-${{ matrix.python }}-*
283279
path: python-footprints/
284280

285281
- name: Validate Isolated Python Statuses
286-
# Inspects the isolated footprint files downloaded for this target Python version.
287-
# If any underlying batch slice reported a 'failure', this step issues a hard exit 1, failing this
288-
# specific check node cleanly and blocking branch merge protections.
289282
run: |
290-
if grep -q -E "failure|cancelled" python-footprints/**/status.txt; then
291-
echo "Error: One or more batches for Python ${{ matrix.python }} failed."
292-
exit 1
283+
if [ -d "python-footprints" ] && [ "$(ls -A python-footprints)" ]; then
284+
TOTAL_BATCHES=$(find python-footprints -name "status.txt" | wc -l | tr -d ' ')
285+
SUCCESS_BATCHES=$(grep -l "success" python-footprints/**/status.txt 2>/dev/null | wc -l | tr -d ' ')
293286
else
294-
echo "Success: All batches for Python ${{ matrix.python }} passed successfully!"
287+
TOTAL_BATCHES=0
288+
SUCCESS_BATCHES=0
289+
fi
290+
291+
if [ "$TOTAL_BATCHES" -gt 0 ] && [ "$TOTAL_BATCHES" -eq "$SUCCESS_BATCHES" ]; then
292+
echo "Success: All $TOTAL_BATCHES batches for Python ${{ matrix.python }} passed successfully!"
293+
else
294+
echo "Error: Validation failed. Expected $TOTAL_BATCHES passing batches, but only got $SUCCESS_BATCHES."
295+
exit 1
295296
fi

0 commit comments

Comments
 (0)