You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/build-ultraplot.yml
+24-12Lines changed: 24 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -235,12 +235,18 @@ jobs:
235
235
status=$?
236
236
set -e
237
237
echo "=== Memory after image comparison ===" && free -h
238
-
if [ "$status" -ne 0 ] && [ -f ./results/junit.xml ]; then
239
-
if python -c "import sys, xml.etree.ElementTree as ET; root = ET.parse('./results/junit.xml').getroot(); suites = list(root.findall('testsuite')) if root.tag == 'testsuites' else [root]; failures = sum(int(s.attrib.get('failures', 0) or 0) for s in suites); errors = sum(int(s.attrib.get('errors', 0) or 0) for s in suites); sys.exit(0 if (failures == 0 and errors == 0) else 1)"
240
-
then
241
-
echo "pytest exited with $status but junit reports no failures/errors; overriding exit status to 0."
242
-
status=0
243
-
fi
238
+
junit_failures=-1
239
+
junit_errors=-1
240
+
if [ -f ./results/junit.xml ]; then
241
+
junit_failures=$(sed -n 's/.*failures="\([0-9][0-9]*\)".*/\1/p' ./results/junit.xml | head -n 1)
242
+
junit_errors=$(sed -n 's/.*errors="\([0-9][0-9]*\)".*/\1/p' ./results/junit.xml | head -n 1)
if [ "$status" -ne 0 ] && [ "$junit_failures" -eq 0 ] && [ "$junit_errors" -eq 0 ]; then
248
+
echo "pytest exited with $status but junit reports no failures/errors; overriding exit status to 0."
249
+
status=0
244
250
fi
245
251
if [ "$status" -eq 4 ] || [ "$status" -eq 5 ]; then
246
252
echo "No tests collected from selected nodeids; skipping image comparison."
@@ -263,12 +269,18 @@ jobs:
263
269
status=$?
264
270
set -e
265
271
echo "=== Memory after image comparison ===" && free -h
266
-
if [ "$status" -ne 0 ] && [ -f ./results/junit.xml ]; then
267
-
if python -c "import sys, xml.etree.ElementTree as ET; root = ET.parse('./results/junit.xml').getroot(); suites = list(root.findall('testsuite')) if root.tag == 'testsuites' else [root]; failures = sum(int(s.attrib.get('failures', 0) or 0) for s in suites); errors = sum(int(s.attrib.get('errors', 0) or 0) for s in suites); sys.exit(0 if (failures == 0 and errors == 0) else 1)"
268
-
then
269
-
echo "pytest exited with $status but junit reports no failures/errors; overriding exit status to 0."
270
-
status=0
271
-
fi
272
+
junit_failures=-1
273
+
junit_errors=-1
274
+
if [ -f ./results/junit.xml ]; then
275
+
junit_failures=$(sed -n 's/.*failures="\([0-9][0-9]*\)".*/\1/p' ./results/junit.xml | head -n 1)
276
+
junit_errors=$(sed -n 's/.*errors="\([0-9][0-9]*\)".*/\1/p' ./results/junit.xml | head -n 1)
0 commit comments