Skip to content

Add Codecov configuration for PR coverage reporting#67

Merged
effigies merged 7 commits intomainfrom
add-codecov-config
Mar 5, 2026
Merged

Add Codecov configuration for PR coverage reporting#67
effigies merged 7 commits intomainfrom
add-codecov-config

Conversation

@astewartau
Copy link
Contributor

@astewartau astewartau commented Mar 5, 2026

Summary

  • Adds codecov.yml to configure coverage status checks and PR comments
  • Project check: fails if overall coverage is below 80%
  • Patch check: requires 80% coverage on new/changed lines
  • PR comments show a condensed coverage impact summary, only when coverage changes
  • Excludes legacy test_bids_validator.py from coverage reporting (broken imports, never runs as part of test suite)

Test plan

  • Verify Codecov PR comment appears on this PR after CI runs
  • Verify coverage status checks show on the PR
  • Pass 80% coverage gate

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.89%. Comparing base (e2e56d4) to head (804f8c5).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #67       +/-   ##
===========================================
+ Coverage   76.83%   90.89%   +14.06%     
===========================================
  Files          13       13               
  Lines         846      846               
  Branches      124      124               
===========================================
+ Hits          650      769      +119     
+ Misses        169       47      -122     
- Partials       27       30        +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

pyproject.toml Outdated
omit = [
"setup.py",
"*/_version.py",
"*/test_bids_validator.py",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why omit this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it already is, at least as far as pytest is concerned at line 65:

[tool.pytest.ini_options]
minversion = "6"
testpaths = ["tests"]  # <~~~~~~~~~~~ here
log_level = "INFO"
xfail_strict = true
addopts = ["-ra", "--strict-config", "--strict-markers"]
filterwarnings = ["error"]
norecursedirs = ["data"]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]

So we should either move the test or update toml to point to it no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should do either of those. I don't care which.

This actually demonstrates why I prefer to check coverage of test files, as it showed that it wasn't being run. So let's run it, rather than hide it.

Copy link

@bendhouseart bendhouseart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure the tests are going to fail once these changes are added, but that aside I think these changes would make it good to go.

@effigies effigies force-pushed the add-codecov-config branch from f7079b5 to 05317fe Compare March 5, 2026 18:53
@effigies
Copy link
Contributor

effigies commented Mar 5, 2026

I can't reproduce these errors locally. Except the one with --pre, since that relaxes the pin and lets chardet get upgraded while requests warns and we error on warnings. What a mess.

astewartau and others added 4 commits March 5, 2026 14:36
Configures coverage status checks (project and patch) and PR comments
so coverage impact is visible directly on pull requests.
This file is a legacy test in the source tree that requires datalad
datasets at import time and is never executed as part of the test suite.
Excluding it gives a more accurate coverage measurement.
@effigies effigies force-pushed the add-codecov-config branch from 05317fe to 982a6ca Compare March 5, 2026 19:36
@effigies effigies merged commit 878d57d into main Mar 5, 2026
23 checks passed
@effigies effigies deleted the add-codecov-config branch March 5, 2026 20:26
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