diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 719e10c55baf..eeff6bb6e0e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -934,7 +934,13 @@ jobs: set -o pipefail cov_params=() if [[ "${SKIP_COVERAGE}" != "true" ]]; then - cov_params+=(--cov="homeassistant") + if [[ "${TEST_GROUP}" == "1" ]]; then + # Also report never-imported files as 0%. Listing every file + # is slow, so only one group does it. + cov_params+=(--cov="homeassistant") + else + cov_params+=(--cov) + fi cov_params+=(--cov-report=xml) cov_params+=(--junitxml=junit.xml -o junit_family=legacy) fi diff --git a/pyproject.toml b/pyproject.toml index 22e11b256686..d2a968653efe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -626,7 +626,11 @@ filterwarnings = [ ] [tool.coverage.run] -source = ["homeassistant"] +# Measure only imported files; pass --cov=homeassistant to also report +# never-imported files as 0% (one CI bucket does that). +include = ["homeassistant/*"] +# --cov= sets source, which overrides include on purpose +disable_warnings = ["include-ignored"] [tool.coverage.report] exclude_lines = [