Add “Number of Tests” Badge to README
To showcase MGCI’s functional coverage and boost user confidence, we want to display a badge indicating the total number of automated tests available.
Objectives
- Dynamically display, in the
README.mdand project badges, a counter of the tests (jobs), propably defined undertemplates/*.yml. - Automatically update this badge on every pipeline run, without manual intervention.
Proposed Implementation**
1. CI Job: count-tests
- New job that:
- Scans the
templates/directory and counts all*.ymlfiles (or MGCI jobs). - Generates a JSON file in Shields.io endpoint format, for example:
{ "schemaVersion": 1, "label": "MGCI tests", "message": "42", "color": "blue" } - Publishes this JSON to
public/status-tests.jsonvia GitLab Pages or as an artifact.
- Scans the
2. Shields.io Badge
- In th project badges add at the top of
README.md:[]()
3. Documentation
- Update doc to explain how to customize or style this badge.
References
- Shields.io endpoint schema: https://shields.io/endpoint
- GitLab Pages & artifacts: https://docs.gitlab.com/ee/user/project/pages/
Acceptance Criteria
-
CI job count-testsproduces and publishesstatus-tests.jsonin pages. -
Badge is present and correctly reflects the test count in README.mdand project badges. -
Documentation updated with instructions for badge configuration. -
Pipeline passes and updates the badge on every merge into main.
Edited by Placeholder Christophe Chaudier