codeclimate / test-reporter

Code Climate Test Reporter
MIT License
156 stars 76 forks source link

Clover parser errors, unable to handle format of xml output #359

Closed efueger closed 6 years ago

efueger commented 6 years ago

A repo with multiple tests resulted in an error formatting its frontend results. (backend results did process fully.)

After

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.

<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>

This: 828e41ef-44da-40a3-a8b3-1dcc858504c1

Versus:

c9b243a9-75a6-4031-b0c1-52305f7a73bb


efueger commented 6 years ago

demo of failing test here: https://github.com/codeclimate/test-reporter/pull/360

efueger commented 6 years ago

User reports switching to lcov and is now able to complete the entire process (format + sum + upload) and it completes successfully with the result "Test report uploaded successfully to Code Climate". 👍

Closing out this issue, as the bug is documented here: https://github.com/codeclimate/test-reporter/pull/360

efueger commented 6 years ago

Follow up for how to exclude files and directories for Jest: