CodeCov CircleCI Orb

Hi @FelicianoTech - thanks for helping me on Twitter (https://twitter.com/FelicianoTech/status/1069702737552654336).

I am trying to accomplish two things:

  1. Get CircleCI to upload my (Istanbul-generated) code coverage report to CodeCov. (Complete).
  2. Set up CodeCov as a check for a GitHub pull request (https://github.com/NYCPlanning/labs-applicantmaps/pull/285). (Still working).

To get #1 to work, I added the following step to my CircleCI config (a step I didn’t see in their setup instructions):

      - run: curl -s https://codecov.io/bash | bash

You posted a link to an orb (not familiar with this feature). Should I use this instead?

Thank you for any help you’re able to provide!

Matt

Hi @allthesignals, Tom from Codecov here.

For #1, either the bash script the way you have it or the orb should work for you. The orb gives you a little more granular control over some features, but this should be enough to get you up or running.

If you do decide that you want to check out the orb, there is some documentation here: https://circleci.com/orbs/registry/orb/codecov/codecov . Also, if you have any feedback or suggestions from the orb, please feel free to reach out.

As for #2, you should be able to add Codecov as a check in your Github settings: https://github.com/NYCPlanning/labs-applicantmaps/settings/branch_protection_rules/new

You are looking for Require status checks to pass before merging

Cheers,
Tom

3 Likes

@thomasrockhu, thank you! I am now seeing this reported in our PRs: https://github.com/NYCPlanning/labs-applicantmaps/pull/285.

Looks like @thomasrockhu beat me to it but I’m here if needed.

1 Like

I’m having problems with codecov orb. Apparently it can’t upload python report.

X> Failed to upload
    -> Sleeping for 30s and trying again...
    -> Pinging Codecov
    -> Uploading
    X> Failed to upload
    -> Sleeping for 30s and trying again...

CircleCI config is here: https://github.com/GPflow/GPflow/pull/892/files#diff-1d37e48f9ceff6d8030570cd36286a61

Does anyone know what is wrong?
@thomasrockhu ?

Thanks,
Artem

Hi @awav,

Thanks for trying out the orb. It looks like we are having some issues with the orb that the team is working on fixing. I’ll be sure to keep you updated here, or if you prefer, via e-mail.

Best,
Tom

Thanks @thomasrockhu, you can share updates here.
Another problem, CI cannot be detected (sometimes):

x> No CI provider detected.
    Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
    Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
    project root: .
    Yaml found at: codecov.yml
...
==> Uploading reports
    url: https://codecov.io
    query: branch=awav%2Fcircleci&commit=ced56f0a9bca7f6fd8ef549bbe3cefabcf7553ea&build=67&build_url=&name=&tag=&slug=GPflow%2FGPflow&service=circleci&flags=-f&pr=&job=0
    -> Pinging Codecov
    -> Uploading
    X> Failed to upload

One more question: I use two jobs, and hence CircleCI uploads 2 different reports of the same PR. Will they be merged into single one at Codecov?

PS: Problem with “CI cannot be detected” is resolved. “CI” environment variable was rewritten with string value.

Best,
Artem

Hi,

Is there any update on this issue?

Hi @awav,

We just released a new version (1.0.2) of the orb which should fix the upload issue. I noticed that you were using the bash uploader as is and that the build is working fine for you.

It also looks like the CI provider is now being detected also.

Finally, Codecov will automatically merge the 2 different upload reports into one. You can, however, use flags if you want to keep some separation between them. Here is the documentation for the flags feature: https://docs.codecov.io/docs/flags

Thanks for bringing up the problem, and let me know if there’s anything else we can do to help.

Best,
Tom

1 Like

Hi @habush

As mentioned, we have released a new version of the orb (1.0.2) that should fix the above issue. Is there something else that is causing you problems?

Best,
Tom

1 Like