“There was an error processing coverage reports” probably caused by wrong file path

Description

Hi, the coverage report generated by Coverage.py is uploaded successfully, but I received the “There was an error processing coverage reports” error. I only want to test python code in a specific subfolder src/framework/rsf. By running the test locally, I found that the file path in the coverage report is /Users/zhichenggeng/RSFROOT/lib/python3.9/site-packages/rsf/flow.py, so I assume in the coverage report from CircleCI, the path is /home/circleci/RSFROOT/lib/python3.8/site-packages/rsf/flow.py. Therefore, I tried to fix the path by

fixes:
  - "/home/circleci/RSFROOT/lib/python3.8/site-packages/::/ahay/src/framework/"

BTW, I’m not sure where to find the commit SHA. Could someone give some instructions.

Commit SHAs

Please include the commit SHA(s)

Repository

CI/CD or Build URL

Uploader

I use the CircleCI CodeCov orb.

Codecov Output

https://app.circleci.com/pipelines/github/ahay/src/358/workflows/e6cccd3f-f79d-4c5d-afb1-4e1614b6717b/jobs/2607

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.2

==> git version 2.20.1 found
==> curl 7.64.0 (x86_64-pc-linux-gnu) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 
==> Circle CI detected.
    project root: .
    Yaml found at: codecov.yml
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + .coverage bytes=77824
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        492K	/tmp/codecov.dibdIL.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=unittest&commit=8c7155408ea376f29998b49c5ab34c634f6a0b3a&build=2607&build_url=&name=2607&tag=&slug=ahay%2Fsrc&service=circleci&flags=&pr=&job=0&cmd_args=f,n,t,?
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-1.0.2&token=secret&branch=unittest&commit=8c7155408ea376f29998b49c5ab34c634f6a0b3a&build=2607&build_url=&name=2607&tag=&slug=ahay%2Fsrc&service=circleci&flags=&pr=&job=0&cmd_args=f,n,t,?
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-05-15/11C2EB3685A24F9A607603665969A656/8c7155408ea376f29998b49c5ab34c634f6a0b3a/28a9050b-4236-41ed-839c-c583d26468b2.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQM3VGPYSAFECJRMNAFIPCV2R3P2BOORCJC7NM537NPJQSFLHUDNIDWA%2F20210515%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20210515T015620Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=69703a7a75f43dd8237556b550845d95b25217f2cbffe9e6468e2e92241348a0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  489k    0     0  100  489k      0  2388k --:--:-- --:--:-- --:--:-- 2388k
    -> Reports have been successfully queued for processing at https://codecov.io/github/ahay/src/commit/8c7155408ea376f29998b49c5ab34c634f6a0b3a

Expected Results

Expect the path fix could solve the problem.

Actual Results

Still shows “There was an error processing coverage reports”.

@zhichenggeng, the coverage report .coverage is not a file format that is accepted by Codecov. It is also I believe a SQL database as it begins

CREATE TABLE t***er (
    f****** integer primary key,

This means that you are likely not uploading the actual coverage report. Can you share a link to your CI?

The path fix you are giving is also for python third-party packages, not your own code. Is that what you expected?

Hi @tom , thanks for your help. The .coverage is the report generated by Coverage.py, so do I need to generate a .xml file? Right now I’m only using the basic command coverage run -m unittest discover framework/rsf/test, which generates the .coverage file. Here is the link to the CI config. You can find it at the end of the file .src/config.yml at unittest · ahay/src · GitHub

The path is actually for our own code. Because, during the test, the package is installed first and then the unittest is run. Therefore, although I tested the file in the code directory, it imports code from the files in the RSFROOT/lib path.

@zhichenggeng, yup, it should actually work if you remove the file specification. If that doesn’t work, just specify coverage xml after line 112

coverage run -m unittest discover framework/rsf/test
coverage xml

I couldn’t remove the file specification. Looks like it is required to use the CircleCI CodeCov orb, so I add coverage xml in the CI file. But it still shows the same error " There was an error processing coverage reports."

@zhichenggeng can you link to the Codecov URL that is showing it?

@tom , here is the link

@zhichenggeng it looks like you are still sending the .coverage file. Can you send the link to your CI? Did you change the file to the produced xml file?

Hi @tom, you are right, I’m still uploading .coverage. I forgot to change the file key. Now it works! Thanks a lot.

1 Like

@zhichenggeng amazing! I’ll also look into making file not a required field.