-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'split' of undefined #137
Comments
I spent the time to go through it and the problem was in the fact that some of our test results had an empty |
Great reporter, however, we are running into this issue too. From the different reports I have seen, many reporters generate failure message of the form: Is this not permitted here? Do you have a schema for the XML you accept, expect, and/or test against? |
For my uses (a customized version of mocha-junit-reporter to fix bugs with suite nesting), and when I tried using the jest-junit parser out of curiosity, it died with the same split error. In my case, java-junit at least works. I also tried mocha-junit, but that fails on trying to call startsWith on undefined. It would be far easier to debug if the tool logged what it was trying to parse when it died, and showed a backtrace! |
hitting this with the below test results xml file
report.xml
|
This commit fixes dorny#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.
This commit fixes dorny#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.
I get
##[error]Cannot read property 'split' of undefined
when parsing test results with the java-junit reporter.I looked at the code of the action and I understand that the error comes from parsing the content of the file. Unfortunately, it's hard for me to pinpoint exactly where that's happening as there's no stacktrace and there's a huge try/catch in main.
I looked at the split calls used in the code, and I'd be tempted to say that the issue could be around parsing the stacktrace of the failing tests. However, the same test failures are happening in other platforms and there the action works just fine. I have this failure only in tests run on UWP.
This is the test run where the issue appears.
I'm using version 1.5.0 because of the nice addition of
path-replace-backslashes
. If you believe that this error could have been introduced by this latest version, I can try to convert the backslashes myself and try 1.4.x .The text was updated successfully, but these errors were encountered: