Skip to content

Conversation

@gitauto-for-dev
Copy link
Contributor

Resolves #408

What is the feature

Add a code coverage ratio to the README.md to display the project's current test coverage.

Why we need the feature

Including a code coverage ratio in the README provides immediate visibility into the test quality and reliability of the project. It helps contributors understand the extent of testing and can encourage improvements in test coverage, leading to more robust and maintainable code.

How to implement and why

  1. Set Up Code Coverage Tool: Use a tool like coverage.py to measure the current test coverage of the project.

  2. Integrate with CI/CD Pipeline:

    • Modify the existing CI configuration (e.g., in .github/workflows/) to run coverage analysis during the test phase.
    • Ensure that the coverage report is generated after tests run.
  3. Generate Coverage Badge:

    • Utilize a service like Codecov or Coveralls to generate a dynamic badge that reflects the latest coverage metrics.
    • Obtain the badge URL from the chosen service.
  4. Update README.md:

    • Add the coverage badge to the top of the README.md for visibility.
    • Optionally, include a section that details the coverage metrics and any relevant insights or trends.
  5. Ensure Automation:

    • Make sure that the coverage badge updates automatically with each commit by maintaining the integration with the CI/CD pipeline.

Reasons:

  • Automating coverage reporting ensures that the coverage ratio is always up-to-date without manual intervention.
  • Using badges provides a quick and visually appealing way to communicate coverage status to all stakeholders.

About backward compatibility

Adding a coverage ratio to the README does not affect the existing functionality of the project. It is purely an informational enhancement, so there are no backward compatibility concerns to address.

Test these changes locally

git fetch origin
git checkout gitauto-wes/issue-408-20241221-191018
git pull origin gitauto-wes/issue-408-20241221-191018

@gitauto-for-dev
Copy link
Contributor Author

gitauto-for-dev bot commented Dec 21, 2024

Committed the Check Run test error fix! Running it again...

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.

Add code coverage ratio to README

2 participants