Skip to content

fix: Add COVERAGE_RCFILE to accept customized .coveragerc #2846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nlou9
Copy link

@nlou9 nlou9 commented Apr 30, 2025

Revisit this closed issue, #1217.
We still face the same issue. Inspired by the comments in the issue thread, we add a COVERAGE_RCFILE environment variable to be able to pass the customized .coveragerc file.

In our own project, we patched this way, and it resolved our issue.

py_test(
    name = "test_utils",
    srcs = ["test_utils.py"],
    data = ["//:.coveragerc"],
    env = {
        "COVERAGE_RCFILE": "$(location //:.coveragerc)",
    },
    deps = [
        ":conftest",
        "//tests/data",
    ],
)

@nlou9 nlou9 marked this pull request as ready for review April 30, 2025 19:34
@nlou9 nlou9 requested review from rickeylev and aignas as code owners April 30, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant