Skip to content

docs: add code coverage section to test README#5717

Open
ABD07xx wants to merge 2 commits intoossf:mainfrom
ABD07xx:docs/coverage-readme
Open

docs: add code coverage section to test README#5717
ABD07xx wants to merge 2 commits intoossf:mainfrom
ABD07xx:docs/coverage-readme

Conversation

@ABD07xx
Copy link
Copy Markdown

@ABD07xx ABD07xx commented Apr 21, 2026

Summary

Adds a Measuring code coverage section to doc/test/README.md, addressing #4952.

The section covers:

  • That pytest-cov is the tool used and is included in the [dev] extras
  • How to run coverage locally (pytest --cov) and produce an HTML report
  • A pointer to the Codecov dashboard for this repo and the ~80% coverage goal (per the maintainer's note in the issue)
  • Where coverage is configured in pyproject.toml ([tool.coverage.run] / [tool.coverage.report])
  • A note that local coverage from a default run only reflects the short test suite, with an example of the gating env vars and flags CI uses

The new section is inserted between Running tests on different versions of Python and Adding new tests: CVE mapping tests, and the table of contents is updated to match.

Test plan

  • pre-commit run --files doc/test/README.md — codespell passes; all Python-only hooks correctly skip the markdown file
  • gitlint --msg-filename on the commit message — passes (Conventional Commits docs: type)
  • Manual review of rendered Markdown for heading/anchor consistency with the rest of the file

fixes #4952

@ABD07xx ABD07xx force-pushed the docs/coverage-readme branch from d34645d to 9cab944 Compare April 21, 2026 05:42
ABD07xx added 2 commits April 27, 2026 17:00
Document how contributors can measure code coverage locally with
pytest-cov, link to the project's Codecov dashboard, and note the
~80% coverage goal. Mentions the pyproject.toml configuration and
the LONG_TESTS / EXTERNAL_SYSTEM gating that affects local figures
versus what CI measures.

fixes ossf#4952

Signed-off-by: ABD <abdullahfazili3614@gmail.com>
Signed-off-by: ABD <abdullahfazili3614@gmail.com>
@ABD07xx ABD07xx force-pushed the docs/coverage-readme branch from 21ae711 to 29a6a21 Compare April 27, 2026 11:30
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.

docs: add code coverage documentation to test README

1 participant