ci: Add coverage reporting to CI - #55
Merged
Merged
Conversation
Add Codecov integration for branch-coverage tracking: - Run pytest with --cov=delaynet --cov-branch on latest Python matrix entry - Upload via codecov/codecov-action@v5 using CODECOV_TOKEN secret - Enforce 100% patch coverage on PRs (codecov.yml) - Add Codecov badge to README
- test_granger: mock np.linalg.solve to raise LinAlgError on second call, covering the lstsq fallback at granger.py:92-94 - metrics: remove redundant if max_betweenness > 0 guard (always True when reached due to outer n_nodes > 2 check), eliminating dead branch - test_network_reconstruction: direct tests for parallel worker functions _compute_pair_connectivity_shared and _compute_with_progress using real shared memory setup
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. Thanks for integrating Codecov - We've got you covered ☂️ |
Merging this PR will degrade performance by 18.83%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_detrend_method[z_score-p10] |
1.8 ms | 2.3 ms | -22.27% |
| ❌ | test_ordinal_patterns |
11.6 ms | 13.7 ms | -15.25% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing chore/add-codecov-ci (34361ea) with main (0a01312)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrate Codecov into the CI pipeline for branch-coverage tracking on PRs, and raise baseline coverage to 100%.
Changes
add
test.ymlon thelatesttest runpytestwith--cov=delaynet --cov-branch --cov-report=xmland upload viacodecov/codecov-action@v5.codecov.yml, new config enforcing:autowith 2% threshold: overall coverage must not drop meaningfullyAdded Codecov badge
Added few missing lines:
granger.py:LinAlgErrorfallback (mocknp.linalg.solveto raise)metrics.py: removed deadif max_betweenness > 0branch (always True when reached)network_reconstruction.py: direct tests for parallel worker functions using real shared memory