-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Summary
Deep evaluation of the Codecov integration for both Pester (PowerShell) and pytest (Python/Hypothesis) pipelines reveals several gaps that reduce accuracy and independent visibility of coverage reporting.
Confirmed Gaps
1. Missing pester project status in codecov.yml
Severity: Medium-High
The pester flag is defined with paths and carryforward, and pester-tests.yml correctly uploads logs/coverage.xml with flags: pester. However, coverage.status.project has no pester entry — only default and pytest:
# Current: only pytest has a flag-specific project status
coverage:
status:
project:
default:
target: auto
threshold: 1%
pytest:
target: auto
threshold: 1%
flags:
- pytest
# ❌ No pester entry — coverage uploads but has no independent PR status checkImpact: Pester coverage regresses silently. It only contributes to the default aggregate status, where regressions in PowerShell scripts can be masked by Python coverage gains (and vice versa).
Fix: Add a pester project status entry:
coverage:
status:
project:
pester:
target: auto
threshold: 1%
flags:
- pester2. --cov=. overrides [tool.coverage.run] source in pytest workflow
Severity: Medium
pytest-tests.yml runs:
uv run pytest --cov=. --cov-report=xml:coverage.xml --cov-report=term-missing -vThe --cov=. CLI argument overrides the source = ["scripts"] setting in pyproject.toml:
[tool.coverage.run]
source = ["scripts"]This means coverage is measured against all Python files in the working directory (including tests, conftest, strategies modules), not just the intended scripts/ source. The fail_under = 85 check runs against this inflated scope.
The Codecov pytest flag filters server-side via paths: [".github/skills/**/scripts/**"], so Codecov's displayed metric may be correct — but the local CI coverage threshold applies to the wrong scope.
Fix: Change --cov=. to --cov so coverage.py reads the source from pyproject.toml:
uv run pytest --cov --cov-report=xml:coverage.xml --cov-report=term-missing -v3. No flag-specific patch coverage
Severity: Low-Medium
coverage.status.patch only has a default entry:
patch:
default:
target: 80%
informational: trueThere are no per-flag (pester, pytest) patch coverage statuses. If one ecosystem has strong patch coverage and the other has none, the aggregate still passes.
Fix: Add flag-specific patch entries:
patch:
pester:
target: 80%
informational: true
flags:
- pester
pytest:
target: 80%
informational: true
flags:
- pytest4. No scheduled baseline coverage runs
Severity: Low
Both flags use carryforward: true but coverage only runs on PRs via pr-validation.yml. The weekly-validation.yml workflow runs only ms.date freshness checks. Direct merges to main (rare but possible) produce no coverage data, and carryforward values grow stale over time.
Fix: Extend weekly-validation.yml with three new jobs:
- pester-coverage — Calls
pester-tests.ymlwithsoft-fail: true,changed-files-only: false, andcode-coverage: trueto upload a full Pester baseline. - discover-python-projects — Finds all
pyproject.tomlfiles and outputs a matrix of Python project directories (same logic aspr-validation.yml). - pytest-coverage — Matrix job calling
pytest-tests.ymlfor each discovered Python project withsoft-fail: trueandchanged-files-only: falseto upload full pytest baselines.
All coverage jobs use id-token: write for Codecov OIDC authentication.
Investigation Notes
What works correctly
pester-tests.ymluploads JaCoCo XML to Codecov withflags: pesteranduse_oidc: true✅pytest-tests.ymluploads Cobertura XML to Codecov withflags: pytestanduse_oidc: true✅pr-validation.ymlwires both workflows with coverage enabled ✅- Pester config (
pester.config.ps1) correctly resolves coverage paths from scripts and skills directories ✅ - Hypothesis-based tests run through pytest-cov and contribute coverage data normally ✅
- Both flags have
carryforward: truefor stable PR status when only one ecosystem changes ✅
Files involved
| File | Role |
|---|---|
codecov.yml |
Codecov platform config (flags, status checks, ignore) |
.github/workflows/pester-tests.yml |
Reusable Pester workflow with Codecov upload |
.github/workflows/pytest-tests.yml |
Reusable pytest workflow with Codecov upload |
.github/workflows/pr-validation.yml |
PR orchestrator calling both test workflows |
.github/workflows/weekly-validation.yml |
Weekly scheduled validation with coverage baselines |
scripts/tests/pester.config.ps1 |
Pester configuration with JaCoCo output |
.github/skills/experimental/powerpoint/pyproject.toml |
Python coverage and test config |
Acceptance Criteria
-
codecov.ymlhas independent project status entries for bothpesterandpytestflags -
pytest-tests.ymlcoverage source matchespyproject.toml[tool.coverage.run] source - Flag-specific patch coverage entries added for
pesterandpytest -
weekly-validation.ymlruns Pester and pytest coverage on a weekly schedule to keep carryforward data fresh