Skip to content
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

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

Closed
efueger opened this issue Sep 17, 2018 · 3 comments
Closed

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

efueger opened this issue Sep 17, 2018 · 3 comments
Assignees
Labels

Comments

@efueger
Copy link
Member

efueger commented Sep 17, 2018

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>

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

Versus:

c9b243a9-75a6-4031-b0c1-52305f7a73bb


  • 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.
@efueger
Copy link
Member Author

efueger commented Sep 18, 2018

demo of failing test here: #360

@efueger
Copy link
Member Author

efueger commented Sep 18, 2018

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:
#360

@efueger efueger closed this as completed Sep 18, 2018
@efueger
Copy link
Member Author

efueger commented Sep 19, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants