Skip to content

Commit 4e420a4

Browse files
committed
fix individual runtime result
1 parent 75e5657 commit 4e420a4

1 file changed

Lines changed: 38 additions & 9 deletions

File tree

.github/workflows/unittest.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
# Configurable global environment variables for batching
1616
env:
17-
BATCH_SIZE: 10
17+
BATCH_SIZE: 5
1818
TEST_ALL_PACKAGES: "true" # Set to "false" to only run tests for packages with a git diff
1919

2020
jobs:
@@ -95,6 +95,10 @@ jobs:
9595
python -m pip install --upgrade setuptools pip wheel
9696
python -m pip install nox
9797
- name: Run unit tests
98+
id: run-tests
99+
# 'continue-on-error: true' is needed to capture the result of individual runtimes
100+
# Otherwise a failure in a single runtime will appear as a failure in all runtimes.
101+
continue-on-error: true
98102
env:
99103
COVERAGE_FILE: ${{ github.workspace }}/.coverage-${{ matrix.python }}
100104
# Dynamically set BUILD_TYPE to an empty string to skip the diff calculation if TEST_ALL_PACKAGES is true
@@ -120,6 +124,22 @@ jobs:
120124
subdirs=("${BATCH_PACKAGES[@]%/}")
121125
122126
ci/run_conditional_tests.sh "${subdirs[@]}"
127+
128+
- 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.
131+
run: |
132+
mkdir -p footprints
133+
echo "${{ steps.run-tests.outcome }}" > footprints/status.txt
134+
135+
- 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.
138+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
139+
with:
140+
name: footprint-${{ matrix.python }}-${{ matrix.batch-index }}
141+
path: footprints/
142+
123143
- name: Upload coverage results
124144
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
125145
with:
@@ -247,19 +267,28 @@ jobs:
247267
unittest-runtime-result:
248268
name: "unit (${{ matrix.python }})"
249269
needs: unit
250-
if: always()
251270
strategy:
252271
matrix:
253272
python: ['3.9', '3.10', "3.11", "3.12", "3.13", "3.14"]
254273
runs-on: ubuntu-latest
255274
steps:
256-
- name: Check unit tests results
257-
run: |
258-
UNIT_STATUS="${{ needs.unit.result }}"
275+
- name: Download Python-Specific Footprints
276+
# Downloads *only* the status footprints matching the specific Python matrix
277+
# version of this cell. This isolates runtime failure detection to prevent a failure in one
278+
# Python track (e.g. 3.14) from falsely blocking status gates on passing tracks (e.g. 3.10).
279+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
280+
with:
281+
pattern: footprint-${{ matrix.python }}-*
282+
path: python-footprints/
259283

260-
if [[ "$UNIT_STATUS" == "success" ]]; then
261-
echo "Python ${{ matrix.python }} tests passed."
262-
else
263-
echo "Error: Python ${{ matrix.python }} status is '$UNIT_STATUS'."
284+
- name: Validate Isolated Python Statuses
285+
# Inspects the isolated footprint files downloaded for this target Python version.
286+
# If any underlying batch slice reported a 'failure', this step issues a hard exit 1, failing this
287+
# specific check node cleanly and blocking branch merge protections.
288+
run: |
289+
if grep -q -E "failure|cancelled" python-footprints/**/status.txt; then
290+
echo "Error: One or more batches for Python ${{ matrix.python }} failed."
264291
exit 1
292+
else
293+
echo "Success: All batches for Python ${{ matrix.python }} passed successfully!"
265294
fi

0 commit comments

Comments
 (0)