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
When creating a test report from the XML file, I get an error that says:
Cannot read property 'split' of undefined
This error only occurs when a subtest fails. Looking closely at the XML file with the test results, I see that the failure element within the testscase element is empty (since this is the parent test case that holds the subtests).
See example here
<?XML version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite test="3" failures="2" time"81.409" name="Test">
<properties>
<property name="go.version" value=:go1.18.10"></property>
</properties>
<testcase classname="test" name="testmain" time="81.000">
<failure message=Failed" type="">
**This is empty since this top-level test case is just a parent test function that holds the test cases**
<failure>
</testcase>
<testcase classname="test" name="subtest1" time="44.590">
<failure message=Failed" type="">
**All the logs from the failed subtest; many, many logs here.**
<failure>
</testcase>
<testcase classname="test" name="subtest1" time="36.410"></testcase>
</testsuite>
</testsuites>
It appears to be related to how the XML file is parsed, as it expects the failure element not to be empty.
I've also been encountering this problem.
My workaround has been to amend the code generating the XML files to ensure that the <failure> tag always has some inner text content. After that, the workflow works again and correctly displays the test reports.
Still, ideally, the code should check this edge case and work even if the <failure> tag doesn't have inner contents.
When creating a test report from the XML file, I get an error that says:
This error only occurs when a subtest fails. Looking closely at the XML file with the test results, I see that the failure element within the testscase element is empty (since this is the parent test case that holds the subtests).
See example here
It appears to be related to how the XML file is parsed, as it expects the failure element not to be empty.
See code here:
https://github.com/dorny/test-reporter/blob/main/src/parsers/java-junit/java-junit-parser.ts#L116
Do you have any workarounds for this behavior?
The text was updated successfully, but these errors were encountered: