Fix CI badge: read test count from testsuite element, not root

pytest junitxml wraps results in <testsuites><testsuite tests="N">,
the count is on the child element, not the root.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alpamys 2026-03-05 20:01:44 +05:00
parent f467dc8014
commit 5de18dc325
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ jobs:
TESTS=$(python -c "
import xml.etree.ElementTree as ET
root = ET.parse('report.xml').getroot()
print(root.attrib.get('tests', '0'))
ts = root.find('testsuite')
print(ts.attrib.get('tests', '0') if ts is not None else root.attrib.get('tests', '0'))
")
echo "Test count: $TESTS"
curl -s -o /dev/null -w "%{http_code}" \