-
Notifications
You must be signed in to change notification settings - Fork 94
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
Cobertura XML is malformed: unescaped quotes in filename string #302
Comments
@DLehenbauer thank you for the bug report. We may need to fix this upstream in the reporting module: We fixed a similar bug in the past, does anything jump out at you, as to where I've missed escaping? |
Thank you for taking a look. I thought it might be an easy one to spot from code inspection, sorry. Here's a reduced repro: git clone https://github.com/DLehenbauer/c8-repro.git
cd c8-repro
npm i
npm run build
npm run test:coverage
head nyc/report/cobertura-coverage.xml Line 10 of the XML is malformed as shown above. The problem seems to be related to using webpack externals to omit 'react' from the bundle. If you remove the line indicated below from the bottom of webpack.prod.js and re-run coverage the resulting XML is valid. externals: [{
'react': 'react', <<-- Delete me
...
}], (Let me know if you have any trouble w/the repo. I can reduce more if it helps.) |
Hi @bcoe - Does this just need |
Some webpacked file using externals introduce file name with quotes in them and Istanbul's cobertura reporter doesn't escape them causing parse error when we publish. A quick fix to patch the file with sed to escape the quotes. (See bcoe/c8#302)
@DLehenbauer I believe you're right that it's probably just a missing escape in that upstream repository, bother you to submit a patch and I should be able to approve? |
Need to update the pattern to patch the code coverage result to work around bcoe/c8#302.
I'm guessing this is a trivial matter of needing to escapify filenames, but am happy to help produce a minimal repro if it would be helpful.
The malformed XML is an unquoted string that occurs when our coverage run includes a webpack'ed bundle that references react as an external module:
(PS - Great project!)
The text was updated successfully, but these errors were encountered: