Fixes#711
When PHPUnit XML output contains <error> or <failure> elements without a
message attribute, the parser now extracts the error message from the error
details text instead of only showing the error type.
The improved logic:
1. Prefer message attribute when present (with type prepended)
2. Extract error message from details when it contains a line matching
the error type (e.g., "TypeError: ...")
3. Fall back to first line of details
4. Finally, use error type as last resort
This provides more informative error messages in test reports when
PHPUnit outputs errors with the full stack trace in the element text
rather than a message attribute.
Test errors are different (represented differently in the JUnit XML
output from jest-junit) to test _failures_. Failures are tests
which ran and failed, errors are for tests/test suites which
did not even run because the test code itself didn't build
or didn't execute correctly.
jest-junit has an option to enable reporting of test suite errors,
but test-reporter then interprets these as successful tests.
Refactor PHPUnit support into separate phpunit-junit parser
Instead of modifying the Java JUnit parser, this creates a dedicated
PHPUnit parser that properly handles PHPUnit's nested testsuite elements.
This keeps the parsers cleanly separated and allows for future PHPUnit-
specific features.
Co-Authored-By: Matteo Beccati <matteo@beccati.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Add python-xunit-parser.ts with associated case statement
Add python-xunit to reporter docs in action.yml
Add tests
Update README
Resolves#244Resolves#633
This commit fixes#137. Some JUnit generators emit an empty failure tag,
with only a message property set. In those cases, the parser crashes
when trying to match the failure with a source file. Since this feature
is optional, the simplest fix is to skip the processing when the failure
tag is empty.
Also added a test, and the corresponding input file is generated from a
reporter within our codebase.
Print message related to suite, instead of a specific test, would break parsing - it would expect test object to be present in dictionary but there would be none.
This fix adds necessary check and messages not related to tracked tests will be ignored.