Closed
Description
A repo with multiple tests resulted in an error formatting its frontend results. (backend results did process fully.)
After
/cc-test-reporter format-coverage backend/clover.xml --input-type clover --output coverage/codeclimate.backend.json
./cc-test-reporter format-coverage frontend/clover.xml --input-type clover --output coverage/codeclimate.frontend.json
Frontend:
circleci@006a46a5bbf8:~/{name_removed}$ ./cc-test-reporter format-coverage frontend/clover.xml --input-type clover -d
DEBU[0000] coverage path frontend/clover.xml
DEBU[0000] using formatter clover
DEBU[0000] checking search path frontend/clover.xml for clover formatter
DEBU[0000] couldn't load committed at from ENV, trying git...
Error: could not find coverage info for source files
Customer sent the output when running these two commands with --debug and the contents of the coverage files.
[contact @efueger for the files]
Eventually, we saw the format of the frontend-clover.xml file was slightly different from the backend-clover.xml.
- While both files contain metrics tags, only the frontend-clover.xml has a "metrics" tag with contents inside of it. Namely this tag:
<metrics statements="3833" coveredstatements="38" conditionals="1515" coveredconditionals="18" methods="758" coveredmethods="8" elements="6106" coveredelements="64" complexity="0" loc="3833" ncloc="3833" packages="24" files="291" classes="291"> . ....... </metrics>
Versus:
- It appears we can't parse files in this format.
- We recommended using clover to turn off this metrics tag. Customer's using Jest, and it doesn't seem to have that config available, so they're going to try using another coverage format supported by both Jest and the Code Climate test collector.