Skip to content

Coverage

# This file is executed by the acceptance test suite (living documentation)
#
# Rules:
#   - Step definitions live in: <test-source-root>/steps/ (or equivalent per language)
#   - Keep scenarios focused: one behaviour per scenario.
#   - Use exact terms from specs/glossary.md.

Feature: Coverage display configuration in GitLab CI/CD Pipelines
    As a software engineer
    I want GitLab to extract and display the coverage percentage from pipeline jobs
    So that coverage is visible in merge requests and on the project overview

    Scenario: Coverage job has language-appropriate GitLab coverage regex
        Given a generated .gitlab-ci.yml for:
            | Languange | Artifact Type |
            | cpp       | tool          |
            | cpp       | library       |
            | cpp       | service       |
            | go        | tool          |
            | go        | library       |
            | go        | service       |
            | java      | library       |
            | java      | service       |
        Then the .gitlab-ci.yml coverage job has the coverage regex for its language:
            | Language | Coverage Regex                                  |
            | cpp      | /^TOTAL.*\s+(\d+\.?\d*%)/                      |
            | go       | /total:\s+\(statements\)\s+(\d+\.\d+%)/        |
            | java     | /Line coverage:\s+(\d+(?:\.\d+)?%)/           |