Problem/Motivation

The GitLab CI template's coverage job reports line coverage but enforces nothing: coverage can silently fall with every merge and only a human reading job output would notice. The project's convention (CONTRIBUTING.md) aims for ~90%; a hard floor below that would catch regressions without making the target itself a gate.

Steps to reproduce

Merge a change that adds substantial untested code: the coverage job still passes, the percentage just drops.

Proposed resolution

Extend the coverage job in .gitlab-ci.yml (keeping the drupal.org template include intact) with a final step that parses the total line coverage from the PHPUnit output and exits non-zero below a threshold. Proposed: hard floor 80%, with ~90% remaining the soft target — a floor you never touch and a target you aim for are different tools.

One caution belongs in the record: hard coverage gates can incent assertion-free "coverage tests" that keep the number green while test quality falls. The mitigation is reviewing what tests assert, not what they touch — the floor only guards against forgetting tests entirely.

Also worth documenting for contributors: code exercised only through BrowserTestBase requests runs in the web-server process and is invisible to coverage collection — kernel tests are what make the number truthful.

Remaining tasks

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

amangrover90 created an issue. See original summary.

amangrover90’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

amangrover90’s picture

Assigned: amangrover90 » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.