Skip to content

Apparently random fluctuations in coverage via CodeCov? #3752

Closed

Description

@peterjc

I would need to go back over some (ideally merged) pull requests to check, but my strong impression compared to when we ran TravisCI/CircleCI/AppVeyor to now with GitHub Actions/CircleCI/AppVeyor, the unit test coverage reported via CodeCov is much more random.

So, it that really the case?

If so, how can we fix it? One hypothesis is that CodeCov is reporting before all the CI tests have finished? e.g. If it only waits for at least one GitHub Actions report, rather than all the GitHub Actions reports?

Activity

  1. seanrjohnson commented on Sep 24, 2021

    @seanrjohnson
    Contributor

    I think this happened with my pull request #3733 also. There were two CI errors, but neither of them seemed to be at all related to the code I wrote. One of them was this CodeCov error.

  2. erik-whiting commented on Nov 12, 2021

    @erik-whiting
    Contributor

    @peterjc can I take a run at this one? If so, can you tell me the significance of the tests ran in CircleCI vs AppVeyor?

    I think I can figure this out on my personal fork but it might involve writing out instructions for a maintainer.

  3. peterjc commented on Nov 14, 2021

    @peterjc
    MemberAuthor

    It might be sensible to start looking purely at the coverage data locally on your own computer (without CodeCov or CircleCI or AppVeyor or GitHub Actions). Does re-running the same set of tests show fluctuating coverage? If so, can you narrow it down to specific test files or even test methods? Anything using random data is a candidate.

    For online testing, you should be able to setup your own CodeCov account for a forked repository, and try pushing data there. One hypothesis is that uploading the data is failing at random (not that I have checked the logs in any details to rule this out).

    Are we simply seeing https://about.codecov.io/blog/codecov-uploader-deprecation-plan/ which has a solution?

  4. erik-whiting commented on Nov 14, 2021

    @erik-whiting
    Contributor

    @peterjc I played around with codecov on a personal project last night and I have a few hypotheses. My first thought is that there are two coverage.xml files being generated--one by appveyor, the other by circle--and only one is shown in the PR comment. This is just a guess at this point though and should not take much time to confirm/deny.

    I'll take your advice on running coverage locally and seeing if the coverage fluctuates. I'll also read chapter 21 of the Biopython tutorial but if there's any high-level concepts about the tests in CircleCI vs tests in AppVeyor you can tell me, I'm sure it'd be helpful.

  5. peterjc commented on Nov 14, 2021

    @peterjc
    MemberAuthor

    Some of the individual tests do use random data (graph plotting comes to mind - as that one very rarely fails as a result of 'bad' data), so I expect a little noise. Those examples in the tests could be replaced with fixed data.

    But we're seeing lots of noise. Your idea that it might be down to only seeing one of the CI system's results not all of them is worth exploring...

  6. peterjc commented on Nov 18, 2021

    @peterjc
    MemberAuthor

    In answer to @erik-whiting's question on #3792, there will be (significant) differences between different test jobs due to them being run with different dependencies (both Python libraries and command line tools). We would ideally test with and without each optional dependency - but adding more dependencies costs us both setup time and run time. This has been a balancing act (coverage vs run time, both to avoid hard limits and for speedy feedback).

    Currently https://github.com/biopython/biopython/blob/master/.appveyor.yml uses the same dependencies for both 32 and 64 bit Python (basically just numpy as the sole hard requirement), so those two jobs would probably give (near) identical coverage.

    CircleCI https://github.com/biopython/biopython/blob/master/.circleci/config.yml currently only runs one set of tests, but with a longer list of dependencies (numpy scipy mmtf-python mysqlclient mysql-connector-python rdflib networkx matplotlib reportlab).

    GitHub actions uses https://github.com/biopython/biopython/blob/master/ci-dependencies.txt (which in hindsight I might prefer be under https://github.com/biopython/biopython/tree/master/.github/workflows as it is not used elsewhere), currently numpy matplotlib mmtf-python mysqlclient mysql-connector-python networkx rdflib reportlab scipy (i.e. as above plus reportlab I think).

    Looking back to the TravisCI days, as per https://github.com/biopython/biopython/blob/biopython-179/.travis-tox.ini#L58 we used to deliberately run a different Python dependency mix on different versions of python - plus a lot of non-Python tools like NCBI BLAST+ via apt-get (see #3797).

    So leaving aside other sources of variation, GitHub actions coverage will be higher than CircleCI, which will be higher than AppVeyor.

  7. peterjc commented on May 8, 2024

    @peterjc
    MemberAuthor

    Right now codecov is broken - I think they changed their upload mechanism or something.

  8. added a commit that references this issue on May 8, 2024
    62abd78
  9. added a commit that references this issue on May 13, 2024
    abf5a3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions