Error merging coverage in python matrix

Please check the troubleshooting guide before creating a ticket.
All fields below are required.

Description

Description of the issue

Codecov won’t merge the results of a python matrix with 4 versions.

Commit SHAs

Please include the commit SHA(s)

de5e13b

Repository

A link to the repository in question

phys2bids

CI/CD or Build URL

Please provide which CI/CD you are using or a link to the build where coverage is being uploaded.

CircleCI

Uploader

Please provide which uploader you are using and command used to run it (e.g. Bash, Node, Python, GitHub Actions, etc…). If you are not using the bash uploader, we recommend switching to it before opening an issue here.

We tried using

coverage combine
coverage xml

and are now trying with

bash <(curl -s https://codecov.io/bash) -v

Codecov Output

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

Fails showing:

Error applying workspace layer for job c2ce40ca-2331-4bcd-a063-a56a037b4f9f: Concurrent upstream jobs persisted the same file(s)

with the coverage combine method and showing:

Downloading workspace layers
  workflows/workspaces/621a2318-2328-4647-84b1-0c121914a33a/0/46a02591-5ab9-4e8d-9907-2bcf820821bb/0/103.tar.gz - 66 MB
  workflows/workspaces/621a2318-2328-4647-84b1-0c121914a33a/0/734db835-1a94-4e3b-88fb-083c5d028ab4/0/103.tar.gz - 66 MB
  workflows/workspaces/621a2318-2328-4647-84b1-0c121914a33a/0/91cd1bb6-9234-4d5b-9eca-837aa0ec8ad8/0/106.tar.gz - 2.9 kB
  workflows/workspaces/621a2318-2328-4647-84b1-0c121914a33a/0/2f04567a-90d1-467a-af1f-a004ff0e38d9/0/107.tar.gz - 2.8 kB
  workflows/workspaces/621a2318-2328-4647-84b1-0c121914a33a/0/e99348bd-0cac-4f55-be4d-4781b37d2511/0/103.tar.gz - 66 MB

with the bash command.

Expected Results

Please provide what you expect to have happened (e.g. a file that has missing coverage on a particular line).

We expected the coverage of the 4 python version to be merged and uploaded to the web.

Actual Results

Please provide what actually happened.

The coverage of the 4 python versions is not merged nor uploaded to the web.

@eurunuela, can you provide the full Codecov output or a CircleCI build URL?

My bad, I thought I did.

Here they are:

Thank you!

@eurunuela, I’m seeing /bin/bash: curl: command not found in those.

#!/bin/bash -eo pipefail
curl -s https://codecov.io/bash | bash -s -- \
  -f "/tmp/src/coverage/coverage.xml" \
  -t "${CODECOV_TOKEN}" \
  -n "${CIRCLE_BUILD_NUM}" \
  -y ".codecov.yml" \
  -F "" \
  -Z || echo 'Codecov upload failed'
/bin/bash: curl: command not found
Codecov upload failed
CircleCI received exit code 0

Are you sure your docker container on CircleCI has curl?

We install curl after the workspace is attached, which is what’s failing here. See our yaml.

  merge_coverage:
    working_directory: /tmp/src/phys2bids
    docker:
      - image: continuumio/miniconda3
    steps:
      - attach_workspace:
          at: /tmp
      - checkout
      - restore_cache:
          key: conda-3.7-v1-{{ checksum "setup.cfg" }}
      - run:
          name: Merge coverage files
          command: |
            apt-get install -yqq curl
            source activate 3.7
            cd /tmp/src/coverage/
            coverage combine
            coverage xml
      - store_artifacts:
          path: /tmp/src/coverage
      - codecov/upload:
          file: /tmp/src/coverage/coverage.xml

@eurunuela, unless I’m mistaken, it looks like it is failing the attach_workspace and jumping right to store_artifacts. I think you’ll need to fix your CircleCI configuration

That’s right, and that’s exactly what I need help with. I don’t get why it doesn’t do the attach_workspace step. How should I fix it?

@eurunuela, this is a CircleCI specific problem. Googling your error message I see this. I’m going to close this out as a result.

1 Like

Thank you! I thought it was codecov related, sorry for that.

1 Like