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/copyJobQueue.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/copyJobQueue.php')
-rw-r--r-- | maintenance/copyJobQueue.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/maintenance/copyJobQueue.php b/maintenance/copyJobQueue.php index 49131bda259f..81199133d1d8 100644 --- a/maintenance/copyJobQueue.php +++ b/maintenance/copyJobQueue.php @@ -23,7 +23,9 @@ use MediaWiki\WikiMap\WikiMap; +// @codeCoverageIgnoreStart require_once __DIR__ . '/Maintenance.php'; +// @codeCoverageIgnoreEnd /** * Copy all jobs from one job queue system to another. @@ -97,5 +99,7 @@ class CopyJobQueue extends Maintenance { } } +// @codeCoverageIgnoreStart $maintClass = CopyJobQueue::class; require_once RUN_MAINTENANCE_IF_MAIN; +// @codeCoverageIgnoreEnd |