Skip to content

Add code coverage tracking and reporting to CI pipeline#274

Merged
Edwardvaneechoud merged 4 commits intomainfrom
claude/add-coverage-reporting-V40z7
Jan 29, 2026
Merged

Add code coverage tracking and reporting to CI pipeline#274
Edwardvaneechoud merged 4 commits intomainfrom
claude/add-coverage-reporting-V40z7

Conversation

@Edwardvaneechoud
Copy link
Copy Markdown
Owner

@Edwardvaneechoud Edwardvaneechoud commented Jan 29, 2026

Summary

This PR adds comprehensive code coverage tracking to the CI/CD pipeline, enabling visibility into test coverage for the backend services and integration with Codecov for coverage monitoring.

Key Changes

  • Coverage Collection: Modified pytest commands for flowfile_core and flowfile_worker tests to collect coverage data using pytest-cov, but only on Ubuntu with Python 3.12 to avoid redundant collection
  • Coverage Reporting: Added a new workflow step that generates and displays a coverage report in the GitHub Actions summary when coverage data is available
  • Artifact Management: Implemented artifact upload for both coverage.xml and .coverage files for downstream processing and archival
  • Codecov Integration: Added automated upload of coverage reports to Codecov with backend-specific flags for tracking
  • Configuration: Added pytest-cov dependency and comprehensive coverage configuration in pyproject.toml including:
    • Source paths for both flowfile_core and flowfile_worker packages
    • Exclusions for test files, cache, and conftest modules
    • Report formatting with missing line indicators and 2-digit precision
  • Gitignore Updates: Added coverage-related files (.coverage, coverage.xml, htmlcov/) to .gitignore

Implementation Details

  • Coverage collection is conditional on matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' to optimize CI performance by running once per test suite
  • The --cov-append flag allows coverage data from multiple test runs to be combined into a single report
  • Coverage report generation gracefully handles cases where tests may be skipped (no coverage data)
  • Codecov upload is non-blocking (fail_ci_if_error: false) to prevent CI failures due to external service issues

- Add pytest-cov dependency to dev dependencies
- Configure coverage settings in pyproject.toml (source paths, omit patterns, report options)
- Update CI workflow to collect coverage on Ubuntu Python 3.12 matrix entry
- Generate combined coverage report with GitHub Actions job summary
- Upload coverage XML artifact and integrate with Codecov
- Add coverage artifacts to .gitignore

https://claude.ai/code/session_01M4NiHP9EDNkLtMFjXpjEvb
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 29, 2026

Deploy Preview for flowfile-wasm canceled.

Name Link
🔨 Latest commit 827b3a9
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/697b6cff68f9aa0008e0ed4f

Edwardvaneechoud and others added 3 commits January 29, 2026 15:14
… together

Set importmode = "importlib" in pytest config to avoid module naming
collisions between flowfile_core/tests/conftest.py and
flowfile_worker/tests/conftest.py. Also fix the section name from
[pytest] to [tool.pytest.ini_options] which is the correct key for
pyproject.toml.

https://claude.ai/code/session_01M4NiHP9EDNkLtMFjXpjEvb
importmode=importlib is incompatible with the existing `from tests.`
imports in both test suites. The test directories use __init__.py and
cross-reference via `from tests.utils import ...`, which requires
pytest's default sys.path manipulation.

Instead, add a `make test_coverage` target that runs core and worker
test suites sequentially (separate pytest processes), combining
coverage with --cov-append. This avoids the conftest collision and
matches the CI approach.

https://claude.ai/code/session_01M4NiHP9EDNkLtMFjXpjEvb
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 29, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@Edwardvaneechoud Edwardvaneechoud merged commit 116896c into main Jan 29, 2026
20 checks passed
@Edwardvaneechoud Edwardvaneechoud deleted the claude/add-coverage-reporting-V40z7 branch February 9, 2026 05:21
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.

3 participants