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
# Re-install the Ultraplot version from the current PR branch
204
218
pip install --no-build-isolation --no-deps .
205
219
206
220
mkdir -p results
207
221
python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')"
208
222
echo "TEST_MODE=${TEST_MODE}"
209
223
echo "TEST_NODEIDS=${TEST_NODEIDS}"
224
+
parse_junit_counts() {
225
+
python -c "import sys,xml.etree.ElementTree as ET; root=ET.parse(sys.argv[1]).getroot(); suites=[root] if root.tag=='testsuite' else root.findall('testsuite'); failures=sum(int(s.attrib.get('failures', 0)) for s in suites); errors=sum(int(s.attrib.get('errors', 0)) for s in suites); print(f'{failures} {errors}')" "$1" 2>/dev/null || echo "0 0"
226
+
}
210
227
if [ "${TEST_MODE}" = "selected" ] && [ -s /tmp/pr_selected_nodeids.txt ]; then
echo "No valid nodeids found on PR branch; skipping image comparison."
@@ -233,14 +253,20 @@ jobs:
233
253
--junitxml=./results/junit.xml \
234
254
"${FILTERED_NODEIDS[@]}"
235
255
status=$?
236
-
set -e
237
256
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."
if [ "$status" -ne 0 ] && [ "$junit_failures" -eq 0 ] && [ "$junit_errors" -eq 0 ]; then
268
+
echo "pytest exited with $status but junit reports no failures/errors; overriding exit status to 0."
269
+
status=0
244
270
fi
245
271
if [ "$status" -eq 4 ] || [ "$status" -eq 5 ]; then
246
272
echo "No tests collected from selected nodeids; skipping image comparison."
@@ -261,14 +287,20 @@ jobs:
261
287
--junitxml=./results/junit.xml \
262
288
ultraplot/tests
263
289
status=$?
264
-
set -e
265
290
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."
0 commit comments