There was an error processing coverage reports with github action

Description

I tried to use codecov with github action but only get “There was an error processing coverage reports.”

Repository

CI/CD

Github action

Uploader

Bash uploader

Commit SHAs

e3fc9b02e750018184b596e68462b78de4b0e9d8

Codecov YAML

No Codecov YAML

Codecov Output

bash codecov.sh -f ./coverage/cobertura-coverage.xml -n codecov-umbrella -F -Z


/ | | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / ` |/ _ / / _ \ \ / /
| |
| (
) | (
| | __/ (
| (
) \ V /
______/ _,|_|____/ _/
Bash-20201009-048fee3

==> GitHub Actions detected.
project root: .
Yaml not found, that’s ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage/cobertura-coverage.xml bytes=17709
==> Appending adjustments
https://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=master&commit=e3fc9b02e750018184b596e68462b78de4b0e9d8&build=300186464&build_url=http%3A%2F%2Fgithub.com%2FAustaras%2Fretask%2Factions%2Fruns%2F300186464&name=codecov-umbrella&tag=&slug=Austaras%2Fretask&service=github-actions&flags=&pr=&job=&cmd_args=f,n,F,Z
-> Pinging Codecov
https://codecov.io/upload/v4?package=bash-20201009-048fee3&token=secret&branch=master&commit=e3fc9b02e750018184b596e68462b78de4b0e9d8&build=300186464&build_url=http%3A%2F%2Fgithub.com%2FAustaras%2Fretask%2Factions%2Fruns%2F300186464&name=codecov-umbrella&tag=&slug=Austaras%2Fretask&service=github-actions&flags=&pr=&job=&cmd_args=f,n,F,Z
-> Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-10-11/097DFF89706A627B714C1F8A898E9A32/e3fc9b02e750018184b596e68462b78de4b0e9d8/d5c94621-7639-4e7e-8e4d-2f8eca89e1cc.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20201011%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20201011T071917Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=d01c6c57d90b8c2f1e3cad9620e0ef0a04fce4da1de7086bd3ca3d01e384f23e
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 1791 0 0 100 1791 0 9476 --:–:-- --:–:-- --:–:-- 9426
100 1791 0 0 100 1791 0 9476 --:–:-- --:–:-- --:–:-- 9426
-> View reports at https://codecov.io/github/Austaras/retask/commit/e3fc9b02e750018184b596e68462b78de4b0e9d8

Hi @Austaras, you can use the -q or -d to print out the report uploaded. What you’ll notice is that the coverage file has files that do not map to any of your files in your repository.

For example,

<class name="ReTask.js" filename="lib/es6/src/ReTask.js" line-rate="0.9615" branch-rate="1">
      <methods>
        <method name="useReducerT" hits="145" signature="()V">
          <lines>
            <line number="10" hits="145"/>
          </lines>
        </method>
        <method name="(anonymous_1)" hits="147" signature="()V">
          <lines>
            <line number="18" hits="147"/>
          </lines>

lib/es6/src/ReTask.js is not actually a file, but probably maps to src/ReTask.re. You will have to find a way to collect coverage on your repo files, or do a text transformation before uploading to Codecov.

That’s unfortunate, lib/es6/src/ReTask.js is generated by bucklescript compiler and isn’t checked into git. There’s no way to map it back as bucklescript hasn’t support sourcemap yet, is there anyway to lift this restriction that it can only collect coverage from file in repo?

@Austaras, are the js and re files the same? If not, the line coverage will not be accurate.

If they are the same, you could write something hacky like

bash <(sed -i .orig 's/\/home\/chla\/Code\/retask\/lib\/es6\///g' <filename>) &&  bash <(sed -i .orig 's/\.js/\.re/g' <filename>) 

as a step before uploading to Codecov