Help with path fixing (configuration does not seem to take effect)


Hello I am experimenting with a complicated CI setup where I need to move the folder where my code resides before running the tests to force the test suite to run against the packaged/installed version of the software instead of the “unpackaged” version available on the CWD.

To be more specific, I have a few folders under the root of the project, and, just before running the tests, I move them to a src/ folder that I just create in the CI.

Since the src folder does not exist in the repository, I tried to use path fixing to allow codecov to find the source code for the files. This is my configuration:

# codecov.yml
comment: false
      threshold: 0.5%
  - "src/::"        # reduce root e.g., "src/setuptools/" => "setuptools/"

However, this configuration does not seem to take any effect, and the src directory still shows up in the report:

Moreover I cannot see coverage line by line, because codecov is not able to find the source files…

I wonder if anyone could help me with that…


CI: Allow codecov to correctly find file paths · abravalheri/setuptools@789e974 · GitHub
commit: Allow codecov to correctly find file paths · abravalheri/setuptools@789e974 · GitHub

Codecov Output

Please provide the full output of running the uploader on your CI/CD. This will typically have the Codecov logo as ASCII.

/usr/bin/bash -n  -F Linux, 3.10 -Q github-action-v1.5.2

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

==> git version 2.34.1 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
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 brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
    Env vars used:
      -> GITHUB_ACTIONS:    true
      -> GITHUB_HEAD_REF:   
      -> GITHUB_REF:        refs/heads/isolated-ci-bkp
      -> GITHUB_REPOSITORY: abravalheri/setuptools
      -> GITHUB_RUN_ID:     1746316062
      -> GITHUB_SHA:        789e974b15c1c73da529093b70f74f2c37ebdd32
      -> GITHUB_WORKFLOW:   tests
    project root: .
    Yaml found at: .codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage.xml bytes=315785
==> Appending adjustments
    -> No adjustments found
==> Gzipping contents
        28K	/tmp/codecov.S0tSYK.gz
==> Uploading reports
    query: branch=isolated-ci-bkp&commit=789e974b15c1c73da529093b70f74f2c37ebdd32&build=1746316062&,3.10&pr=&job=tests&cmd_args=n,F,Q
->  Pinging Codecov,3.10&pr=&job=tests&cmd_args=n,F,Q
->  Uploading to
  % 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 24654    0     0  100 24654      0  62892 --:--:-- --:--:-- --:--:-- 62892
    -> Reports have been successfully queued for processing at

Expected Results

  • to not see any mentions to src in the codecov UI
  • to be able to browse the report in the codecov UI and see the files line by line (codecov should be able to find the correct files in the github repository).

Actual Results

  • the src directory shows up in the codecov UI
  • codecov cannot find the correct files in the github repository (since it does not seem to apply the path fix specified in the codecov.yml file).

Additional Information

Example of paths in the XML file being uploaded (note how they start with src/ and therefore should be fixed by the rule in codecov.yml):

<class name="" filename="src/pkg_resources/" complexity="0" line-rate="0.8342" branch-rate="0">

My expectation would be this showing up as pkg_resources/ in the UI, after the path fix.

@abravalheri you have an error in your yaml

comment: false
        threshold: 0.5%
  - "src/::" 

You can validate it in the future following these instructions. Let me know if that fixes your issue.

Thank you very much @tom, that was indeed the issue!