noteflowai/evalarc · 0.23.3 · 2026-11-17

fix: compare JUnit testcases in nested suites under a root <testsuite> instead of silently dropping them

'evalarc diff' and load_results now read testcases inside nested <testsuite> elements when the JUnit document root is a single <testsuite>. Before this fix, only the root suite's direct testcases were read, and nested ones were dropped without a message. Nested testcases now go through the normal diff and appear in diff.json, summary.md, index.html and the 'Why the gate failed' section. A nested check that regresses, is removed or becomes unassessed makes the command exit 1. A case ID is the classname if present. Otherwise it is the name of the suite that directly contains the testcase, followed by '::' and the testcase name. identity.suites lists every suite visited, nested ones included. An unnamed nested testcase raises the existing ValueError, which names its position and its suite, and the CLI exits 2. Files with a <testsuites> root and flat <testsuite> files are parsed as before. The English and zh-CN CI gate docs each describe the nested-suite rule. Measured results, all executed by the controller (the author ran nothing): the new acceptance test, run in its pre-fix acceptance check, had 4 of 5 tests fail. The failures covered the nested case load, the regression, the removal and the unnamed-testcase error, and they show the defect. On commit 2f612e113790b89471b5515adaff726f8d89e61c, the controller ran the new acceptance test, the full pytest suite, ruff check, ruff format --check, scripts/build_site.py and scripts/check_site.cjs. All exited 0.

Use it

Prerequisites: Python, a POSIX shell, and evalarc installed from a release or checkout that contains commit 2f612e1 (for example, run pip install . in that checkout). The two XML files below are synthetic and were written by hand for this example.

cat > baseline.xml <<'EOF'
<testsuite name="outer"><testcase name="a"/><testsuite name="inner"><testcase name="b"/></testsuite></testsuite>
EOF
cat > current.xml <<'EOF'
<testsuite name="outer"><testcase name="a"/><testsuite name="inner"><testcase name="b"><failure message="synthetic failure"/></testcase></testsuite></testsuite>
EOF
evalarc diff baseline.xml current.xml --output junit-diff
echo "exit code: $?"

Expected result: exit code 1. A 'regressed' change for inner::b (baseline status passed) appears in junit-diff/diff.json and under 'Why the gate failed' in junit-diff/summary.md. Before this fix, the same inputs reported no change for inner::b, because the nested testcase was never read. In GitHub Actions, add --markdown "$GITHUB_STEP_SUMMARY" to append the summary to the job page. To rerun the acceptance tests from a checkout: python -m pytest -q tests/test_feature_1513446e184d.py

Scope

This change is limited to the JUnit parser in _junit, reached through the existing 'evalarc diff' command and load_results. There is no new flag, format, output field or change kind, and the gate rules, exit codes and output layout are unchanged. Testcases placed directly under <testsuites> outside any suite are still not read. Properties and system-out are still ignored. The acceptance tests use small synthetic XML because no real export with nested suites was supplied. Passing tests show the behavior only for those synthetic cases and the existing suite. Which test runners or JUnit schemas write nested suites under a root <testsuite> is unverified. No user report of this defect exists. This change has no UI. The controller's scripts/build_site.py and scripts/check_site.cjs run passed. That run included the existing showcase browser checks at 1440, 390 and 320 px widths, covering keyboard, link, download and offline behavior. Those checks cover existing showcase pages and do not test this parser change, and no visual review of index.html output for nested-suite inputs was done. All checks were executed by the controller. The author had no tools and did not run or observe them directly.

Upgrade and rollback

Install a release that contains commit 2f612e1. Result files are re-parsed on every diff, so no data migration is needed. Results for <testsuites> files and flat <testsuite> files do not change. A gate on files with nested suites under a root <testsuite> may now fail on checks it ignored before. This is the intended correction. Review those findings, or commit a new baseline in a reviewed change. To roll back, pin the previous evalarc version. Rolling back brings back the silent dropping of nested testcases. Input files and earlier output folders are never modified.

Source commit: 5060961438098d52c939ef13f0cf624cf9fab83b