Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ | Rejoignez-nous sur le Chat 💬

Skip to content

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.md and project badges, a counter of the tests (jobs), propably defined under templates/*.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 *.yml files (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.json via GitLab Pages or as an artifact.

2. Shields.io Badge

  • In th project badges add at the top of README.md:
    [![MGCI Tests](https://img.shields.io/endpoint?url=https://<YOUR-PAGES-URL>/status-tests.json)]()

3. Documentation

  • Update doc to explain how to customize or style this badge.

References

Acceptance Criteria

  • CI job count-tests produces and publishes status-tests.json in pages.
  • Badge is present and correctly reflects the test count in README.md and 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