Skip to content

ci: measure coverage in the integration job too - #1298

Draft
frapercan wants to merge 2 commits into
developfrom
ci/measure-integration-coverage
Draft

frapercan wants to merge 2 commits into
developfrom
ci/measure-integration-coverage

Conversation

@frapercan

Copy link
Copy Markdown
Owner

Why

Coverage is collected only by the unit job (test.yml), which runs without Postgres. Every line that only a Postgres test reaches is therefore reported as uncovered on Codecov, even though the integration job (integration.yml, a required check) exercises it against a real Postgres and a broker.

#1297 shows it clearly. Codecov reported 53.6 % patch coverage, with 26 lines missing in _photo_sequences.py, export_evaluation_targets.py, _batch_op_feature.py and transitions_export/_queries.py. Those 26 lines are the photo branches, and tests/test_a_photo_run_reads_the_cut_inputs.py runs them in this job. The same gap is the likely reason codecov/project/core (85 % over protea/core/) is red on unrelated pull requests, including documentation-only ones.

What

integration.yml now:

  • runs pytest --with-postgres --cov=protea --cov-report=xml -q;
  • uploads coverage.xml with codecov/codecov-action@v5 and fail_ci_if_error: false, the same action and tolerance as the unit job.

Codecov merges the uploads of a commit, so the Postgres-only lines count where they actually run. Nothing gates on this upload. The coverage floor stays in the unit job (--cov-fail-under=65), and the required checks do not change.

How to check it

  • The integration job on this pull request uploads a second report.
  • Codecov's comment for this commit lists both uploads.
  • codecov/project/core reads the merged coverage of protea/core/.

The unit job measures coverage without Postgres, so Codecov reported
every line that only a Postgres test reaches as uncovered, however well
the integration job tested it. The photo readers of #1297 are one case:
26 lines exercised against a real Postgres in this job, shown as missing.

The integration job now runs the suite with --cov and uploads its report
with the same action and tolerance as the unit job. Codecov merges the
uploads of a commit, so the Postgres-only lines count where they run.
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.08%. Comparing base (8035fb7) to head (38f1a78).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1298      +/-   ##
===========================================
+ Coverage    85.66%   89.08%   +3.42%     
===========================================
  Files          472      472              
  Lines        37463    37463              
===========================================
+ Hits         32091    33373    +1282     
+ Misses        5372     4090    -1282     

see 50 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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