NAME
Dist::Zilla::Plugin::DBIO::CoverageGate - Judge the Devel::Cover database after the whole test suite has run
VERSION
version 0.900007
DESCRIPTION
Part of the [@DBIO] bundle. A coverage gate that runs after the test suite: it is a Dist::Zilla::Role::TestRunner placed behind the build plugin (MakeMaker or MakeMaker::Awesome), so Dist::Zilla calls it once the suite of the built distribution has finished. It reads the cover_db/ in the build directory, which a suite run under HARNESS_PERL_SWITCHES=-MDevel::Cover has filled, and it scores the statement coverage of the distribution's own lib/ (lib/ and blib/lib/ of the build directory; vendor code, perl's own libraries and Devel::Cover stay out). The gate runs for dzil test and dzil release. It judges the whole run, also under a parallel harness, and does not depend on the names or the directories of the test files.
The gate merges the runs of a fresh cover_db/ itself ("merge_runs" in Devel::Cover::DB), so a plain coverage run is scored without a prior cover.
A score below the threshold only logs a warning, so a low-coverage run never blocks dzil test for developers. With COVERAGE_STRICT=1 or RELEASE=1 in the environment it aborts. A release without a measured coverage is a failed release, so under RELEASE=1 the gate also aborts when there is no cover_db/, when Devel::Cover::DB is not installed, when the database is not valid, or when no lib/ file was measured; without RELEASE=1 these only log a note. The failure names the overall score and then the 20 modules with the lowest coverage, lowest first; a success names the overall score.
With a threshold of 0 the gate is off and only logs that.
ATTRIBUTES
coverage_threshold
Statement-coverage percentage required for a passing run. Default: 80.
AUTHOR
DBIO Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.