diff options
author | Dreamy Jazz <wpgbrown@wikimedia.org> | 2024-08-27 13:00:25 +0100 |
---|---|---|
committer | Dreamy Jazz <wpgbrown@wikimedia.org> | 2024-08-27 13:22:29 +0100 |
commit | e7393b3cc7ade5ccc44bf5b466f26d3c51063fff (patch) | |
tree | 13350294b27d26aa87611189907be81e74ec7978 /maintenance/populateInterwiki.php | |
parent | be2bef0de5c1e59ba7f25a672349f0915b1c4d33 (diff) | |
download | mediawikicore-e7393b3cc7ade5ccc44bf5b466f26d3c51063fff.tar.gz mediawikicore-e7393b3cc7ade5ccc44bf5b466f26d3c51063fff.zip |
Exclude boilerplate maintenance code from code coverage reports
Why:
* Maintenance scripts in core have bolierplate code that is
added before and after the class to allow directly running
the maintenance script.
* Running the maintenance script directly has been deprecated
since 1.40, so this boilerplate code is only to support a now
deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
coverage reports as it cannot be marked as covered and also
is for deprecated code.
What:
* Wrap the boilerplate code (requiring Maintenance.php and then
later defining the maintenance script class and running if the
maintenance script was called directly) with @codeCoverageIgnore
comments.
* Some files use a different boilerplate code, however, these
should also be marked as ignored for coverage for the same
reason that coverage is not properly reported for files.
Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
Diffstat (limited to 'maintenance/populateInterwiki.php')
-rw-r--r-- | maintenance/populateInterwiki.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/maintenance/populateInterwiki.php b/maintenance/populateInterwiki.php index 4f0164696ad9..b697ef03c08c 100644 --- a/maintenance/populateInterwiki.php +++ b/maintenance/populateInterwiki.php @@ -24,7 +24,9 @@ * @author Katie Filbert < aude.wiki@gmail.com > */ +// @codeCoverageIgnoreStart require_once __DIR__ . '/Maintenance.php'; +// @codeCoverageIgnoreEnd class PopulateInterwiki extends Maintenance { @@ -152,5 +154,7 @@ TEXT } +// @codeCoverageIgnoreStart $maintClass = PopulateInterwiki::class; require_once RUN_MAINTENANCE_IF_MAIN; +// @codeCoverageIgnoreEnd |