Skip to content

CI Collect coverage results on the CUDA CI #32697

Closed

Description

@betatim

We currently don't collect and report coverage information to codecov for the CUDA CI, see #31829 (comment)

The .github/workflows/unit-tests.yml script contains a working setup for collecting coverage and uploading it to codecov using GitHub Actions. This is probably a good starting point for the CUDA CI which is defined in .github/workflows/cuda-ci.yml. We might also have to adjust the options passed to pytest in the CUDA CI so that it generates coverage statistics.

One thing to double check/think about is how having a CI that only runs sometimes ends up being displayed on codecov when comparing commits. For example, if main has no coverage for some code because we don't run the CUDA CI on main will it always look like you have missing coverage on a PR? Or does it not matter because our coverage requirements are calculated on the diff only?

Activity

  1. moved this to Todo in Array APIon Nov 12, 2025
  2. lesteve commented on Nov 12, 2025

    @lesteve
    Member

    Uploading coverage for the CUDA CI seems doable in finite time but I am wondering about how useful this would actually be in practice.

    As an not-related data point, we don't have coverage on Windows (was removed because it was too slow a while ago) and I don't think that it a blind spot that has harmed us in the past.

    Personally I only look at the coverage when it is red and if the not covered lines are a bit of an edge case, I am like "let's not bother about it".

    One thing to double check/think about is how having a CI that only runs sometimes ends up being displayed on codecov when comparing commits

    I think patch coverage is based on difference between the PR and main (or the common ancestor
    between the PR branch and main?) and not between one commit and the next one.

    The codecov page tells you the commit it is comparing against for example this one

    Image

    One thing to double check/think about is how having a CI that only runs sometimes ends up being displayed on codecov when comparing commits. For example, if main has no coverage for some code because we don't run the CUDA CI on main will it always look like you have missing coverage on a PR?

    If I had a bet to place, I would guess it's the other way around, a PR with the CUDA label will always have more coverage than main (assuming we don't run the CUDA CI on main which is what we do currently)? I would guess that the additional coverage would be quite small though and would be ignored in practice.

  3. betatim commented on Nov 12, 2025

    @betatim
    MemberAuthor

    In the linked PR it came up that we are missing a bit of coverage. Hence this issue. If it isn't a lot of work and doesn't add a lot of runtime I'd vote for adding it. But low priority.

  4. lesteve commented on Nov 13, 2025

    @lesteve
    Member

    In the linked PR it came up that we are missing a bit of coverage. Hence this issue.

    Yep I got that. I was talking mostly about main without CUDA CI compared to PR with CUDA CI (in the case we do add coverage to the CUDA CI), which I thought was one of the worries/questions.

  5. added
    Needs Decision
    on Nov 17, 2025
  6. github-actions commented on Nov 17, 2025

    @github-actions

    Thanks for the work you've done so far. The goal of this comment
    is to set expectations.

    Deciding on new features or substantial changes is a lengthy
    process. It frequently happens that no maintainer is available
    to take on this task right now.

    Please do not create a Pull Request before a decision has been
    made regarding the proposed work. Making this decision can
    often take a significant amount of time and effort.

  7. betatim commented on Nov 27, 2025

    @betatim
    MemberAuthor

    If someone wants to implement this, it would be welcome. It should mostly be a question of copying the relevant bit of .github/workflows/unit-tests.yml to the cuda-ci.yml. Then fixing what doesn't work.

    It isn't a super high priority though as we only rarely run into the problem of missing coverage.

  8. removed
    Needs Decision
    on Nov 27, 2025
  9. betatim commented on Mar 23, 2026

    @betatim
    MemberAuthor

    A few months later now I think we don't need this. We use array_api_strict in our normal CI that runs all the time on everything. This should cover all "not numpy" paths. The only exception being branches that are specific to a particular GPU library (if is_cupy(X) style). We have very few to none of those and don't really want to have them either.

    In conclusion I think it isn't worth the work and maintenance to do this. A better way to spend our effort would be to work on array_api_strict to make sure it is top notch for testing (no weird quirks and edge cases due to how it is made).

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions