Codecov website can not show line by line coverage


On the Codecov website, the coverage looks properly displayed, but once you select the file, it displays this error:

There was a problem getting the source code from your provider. Unable to show line by line coverage.


The XML coverage and the upload is done on this GitHub action CI: mne-icalabel/unit_tests.yml at 07beb68637dd9c0e962492f87a8f8fe8d8857023 · mne-tools/mne-icalabel · GitHub

      - name: Run pytest  # headless via Xvfb on linux
        uses: GabrielBB/xvfb-action@v1.6
          run: pytest main/mne_icalabel --cov=main/mne_icalabel --cov-report=xml --cov-config=main/pyproject.toml
      - name: Upload coverage stats to codecov
        if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && matrix.mne == 'stable' }}
        uses: codecov/codecov-action@v3
          files: ./coverage.xml
          fail_ci_if_error: true
          verbose: true

Codecov Output

==> linux OS detected
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (66cbf87269acc529c87f6ea29395ba329f528e92cfda4fc199eab460123e18b6  codecov)
==> Running version latest
==> Running version v0.2.5
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.0 -Z -f ./coverage.xml -C 83bf6071f44d3a2f803e738529d8b0896d6f4256 -v
[2022-08-08T10:39:53.758Z] ['verbose'] Start of uploader: 1659955193758...
[2022-08-08T10:39:53.760Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.2.5
[2022-08-08T10:39:53.775Z] ['info'] => Project root located at: /home/runner/work/mne-icalabel/mne-icalabel
[2022-08-08T10:39:53.777Z] ['info'] -> No token specified or token is empty
[2022-08-08T10:39:53.777Z] ['verbose'] Start of network processing...
[2022-08-08T10:39:53.777Z] ['verbose'] Searching for files in /home/runner/work/mne-icalabel/mne-icalabel
[2022-08-08T10:39:53.925Z] ['verbose'] Skipping coveragepy, files already specified
[2022-08-08T10:39:53.926Z] ['info'] Searching for coverage files...
[2022-08-08T10:39:54.020Z] ['verbose'] Preparing to clean the following coverage paths: ./coverage.xml
[2022-08-08T10:39:54.021Z] ['info'] => Found 1 possible coverage files:
[2022-08-08T10:39:54.021Z] ['verbose'] End of network processing
[2022-08-08T10:39:54.021Z] ['info'] Processing ./coverage.xml...
[2022-08-08T10:39:54.026Z] ['info'] Detected GitHub Actions as the CI provider.
[2022-08-08T10:39:54.026Z] ['verbose'] -> Using the following env variables:
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_ACTION: __codecov_codecov-action
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_HEAD_REF: coverage
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_REF: refs/pull/94/merge
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_REPOSITORY: mne-tools/mne-icalabel
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_RUN_ID: 2817244728
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_SERVER_URL:
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_SHA: c09821e5bc25cc941b2ce2ff27bccb2cdd7e1bb3
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_WORKFLOW: unit-tests
[2022-08-08T10:39:54.028Z] ['verbose'] Using the following upload parameters:
[2022-08-08T10:39:54.028Z] ['verbose'] branch
[2022-08-08T10:39:54.028Z] ['verbose'] build
[2022-08-08T10:39:54.028Z] ['verbose'] buildURL
[2022-08-08T10:39:54.028Z] ['verbose'] commit
[2022-08-08T10:39:54.028Z] ['verbose'] job
[2022-08-08T10:39:54.029Z] ['verbose'] pr
[2022-08-08T10:39:54.029Z] ['verbose'] service
[2022-08-08T10:39:54.029Z] ['verbose'] slug
[2022-08-08T10:39:54.029Z] ['verbose'] name
[2022-08-08T10:39:54.029Z] ['verbose'] tag
[2022-08-08T10:39:54.029Z] ['verbose'] flags
[2022-08-08T10:39:54.030Z] ['verbose'] parent
[2022-08-08T10:39:54.038Z] ['info'] Pinging Codecov:*******&branch=coverage&build=2817244728&
[2022-08-08T10:39:54.039Z] ['verbose'] Passed token was 0 characters long
[2022-08-08T10:39:54.039Z] ['verbose']
        Content-Type: 'text/plain'
        Content-Encoding: 'gzip'
        X-Reduced-Redundancy: 'false'
[2022-08-08T10:39:54.666Z] ['info']
[2022-08-08T10:39:54.666Z] ['verbose'] Returned upload url:
[2022-08-08T10:39:54.667Z] ['info'] Uploading...
[2022-08-08T10:39:54.893Z] ['info'] {"status":"success","resultURL":""}
[2022-08-08T10:39:54.893Z] ['verbose'] End of uploader: 1135 milliseconds

I’ve been looking around at what could cause this, but I am at a lost. Any help on configuring Codecov correctly would be appreciated!


@mscheltienne, can you try adding this to your codecov.yml file?

  - "main/::" 

Looks like you the coverage reports being uploaded have a prepended main directory

1 Like

Thanks for the suggestion. Unfortunately, it does not seem to work. I tried it on this repository which has a similar setup: GitHub - mscheltienne/simple-stimuli: Simple auditory and visual stimuli that do not require PsychoPy.

main was also pre-prended by the CIs, as you can see here: simple-stimuli/pytest.yml at e91e753350e8676541e1a6926884cc56fc165bb0 · mscheltienne/simple-stimuli · GitHub and simple-stimuli/pytest.yml at e91e753350e8676541e1a6926884cc56fc165bb0 · mscheltienne/simple-stimuli · GitHub

On the mne-icalabel repo, I tried a different fix: I replaced main/mne_icalabel with mne_icalabel in the cov argument of pytest (and thus did not add a .codecov.yml file.

Neither worked!

Nevermind, it just took a bit of time to update!

1 Like