codecov-action icon indicating copy to clipboard operation
codecov-action copied to clipboard

Make requirement that coverage *must* be in XML more obvious

Open ktbarrett opened this issue 4 years ago • 7 comments

Spent a good hour on this until I realized that maybe everyone was running coverage xml for a reason. It is only implied and never out-right mentioned in the README.

ktbarrett avatar Jul 31 '21 05:07 ktbarrett

Found that the coverage file doesn't need to be an XML file.

Just the .coverge file is not considered as a 'coverage file' like the old bash uploader.

You must specify it manually in config files: .coverage, no need to run coverage xml.

trim21 avatar Aug 14 '21 13:08 trim21

I was specifying files: .coverage and it was being uploaded, but it was considered corrupt (I don't remember the exact error message at this point).

ktbarrett avatar Aug 14 '21 13:08 ktbarrett

It works for me, but now it looks like there are more bugs than I thought...

trim21 avatar Aug 14 '21 13:08 trim21

Oh, I misunderstood you, yes this file isn't processed correctly, you are right.

------------------ Original ------------------ From: @.>; Date: 2021年8月14日(星期六) 晚上9:56 To: @.>; Cc: @.>; @.>; Subject: Re: [codecov/codecov-action] Make requirement that coverage must be in XML more obvious (#456)

I was specifying files: .coverage and it was being uploaded, but it was considered corrupt (I don't remember the exact error message at this point).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

trim21 avatar Aug 14 '21 19:08 trim21

The Python example suggests that codecov will run something called coveragexml for us which does this job:

Codecov will call coveragexml -i automatically to generate the coverage xml output, which will be archived and processed server side.

But this doesn't seem to actually be the case. Could the documentation be updated to clarify what actually needs to happen?

jacksonj04 avatar Sep 15 '21 09:09 jacksonj04

Ah, good to know...

dmail avatar Nov 02 '21 07:11 dmail

It works fine with JSON for me:

[2021-11-02T07:58:05.090Z] ['info'] => Found 1 possible coverage files:
  ./coverage/coverage.json
[2021-11-02T07:58:05.090Z] ['verbose'] End of network processing
[2021-11-02T07:58:05.090Z] ['info'] Processing ./coverage/coverage.json...
[2021-11-02T07:58:05.094Z] ['info'] Using manual override from args.

image

dmail avatar Nov 02 '21 08:11 dmail

The uploader now runs coverage xml by default if coverage is installed (a dep of pytest-cov)

thomasrockhu-codecov avatar Mar 23 '23 02:03 thomasrockhu-codecov