Page MenuHomePhabricator

Improve test coverage for maintenance scripts in core
Open, Needs TriagePublic

Description

The maintenance scripts in core are nearly all untested, with a 5% test coverage for the folder reported by https://doc.wikimedia.org/cover/mediawiki-core/maintenance/index.html.

Testing these maintenance scripts is important, as a bug in some of the more important scripts could cause issues. It also makes it easier to run less-used maintenance scripts, without having to check that they have not broken due to regressions.

Details

SubjectRepoBranchLines +/-
mediawiki/coremaster+62 -7
mediawiki/coremaster+120 -0
mediawiki/coremaster+95 -0
mediawiki/coremaster+75 -5
mediawiki/coremaster+618 -1
mediawiki/coremaster+133 -9
mediawiki/coremaster+195 -0
mediawiki/coremaster+115 -0
mediawiki/coremaster+34 -0
mediawiki/coremaster+74 -0
mediawiki/coremaster+258 -2
mediawiki/coremaster+69 -2
mediawiki/coremaster+37 -0
mediawiki/coremaster+109 -13
mediawiki/coremaster+88 -4
mediawiki/coremaster+108 -9
mediawiki/coremaster+9 -2
mediawiki/coremaster+57 -0
mediawiki/coremaster+51 -0
mediawiki/coremaster+60 -2
mediawiki/coremaster+15 -0
mediawiki/coremaster+126 -42
mediawiki/coremaster+23 -7
mediawiki/coremaster+54 -0
mediawiki/coremaster+26 -0
mediawiki/coremaster+12 -8
mediawiki/coremaster+51 -0
mediawiki/coremaster+49 -0
mediawiki/coremaster+71 -0
mediawiki/coremaster+30 -0
mediawiki/coremaster+41 -0
mediawiki/coremaster+62 -0
mediawiki/coremaster+112 -0
mediawiki/coremaster+1 -0
mediawiki/coremaster+3 -3
mediawiki/coremaster+113 -1
mediawiki/coremaster+34 -2
mediawiki/coremaster+31 -0
mediawiki/coremaster+73 -0
mediawiki/coremaster+82 -0
mediawiki/coremaster+71 -0
mediawiki/coremaster+115 -0
mediawiki/coremaster+51 -1
mediawiki/coremaster+97 -10
mediawiki/coremaster+125 -1
mediawiki/coremaster+127 -6
mediawiki/coremaster+47 -0
mediawiki/coremaster+878 -0
mediawiki/coremaster+87 -0
mediawiki/coremaster+64 -0
mediawiki/coremaster+37 -0
mediawiki/coremaster+38 -0
mediawiki/coremaster+158 -1
mediawiki/coremaster+117 -0
mediawiki/coremaster+200 -0
mediawiki/coremaster+69 -0
mediawiki/coremaster+63 -4
mediawiki/coremaster+24 -0
mediawiki/coremaster+52 -0
mediawiki/coremaster+14 -0
mediawiki/coremaster+10 -1
mediawiki/coremaster+15 -0
mediawiki/coremaster+10 -0
mediawiki/coremaster+54 -0
mediawiki/coremaster+52 -0
mediawiki/coremaster+12 -0
mediawiki/coremaster+17 -0
mediawiki/coremaster+45 -2
mediawiki/coremaster+72 -2
mediawiki/coremaster+47 -0
mediawiki/coremaster+25 -0
mediawiki/coremaster+19 -1
mediawiki/coremaster+49 -1
mediawiki/coremaster+16 -0
mediawiki/coremaster+48 -0
mediawiki/coremaster+83 -2
mediawiki/coremaster+17 -0
mediawiki/coremaster+3 -3
mediawiki/coremaster+73 -0
mediawiki/coremaster+112 -0
mediawiki/coremaster+104 -15
mediawiki/coremaster+40 -0
mediawiki/coremaster+35 -0
mediawiki/coremaster+24 -0
mediawiki/coremaster+28 -0
mediawiki/coremaster+23 -0
mediawiki/coremaster+64 -0
mediawiki/coremaster+47 -0
mediawiki/coremaster+95 -0
mediawiki/coremaster+84 -0
mediawiki/coremaster+104 -0
mediawiki/coremaster+46 -0
mediawiki/coremaster+84 -0
mediawiki/coremaster+167 -0
mediawiki/coremaster+32 -0
mediawiki/coremaster+77 -0
mediawiki/coremaster+26 -10
mediawiki/coremaster+71 -0
mediawiki/coremaster+62 -0
mediawiki/coremaster+55 -0
mediawiki/coremaster+71 -0
mediawiki/coremaster+35 -0
mediawiki/coremaster+40 -0
mediawiki/coremaster+74 -0
mediawiki/coremaster+50 -0
Show related patches Customize query in gerrit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change #1067329 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Exclude boilerplate maintenance code from code coverage reports

https://gerrit.wikimedia.org/r/1067329

Change #1067329 merged by jenkins-bot:

[mediawiki/core@master] Exclude boilerplate maintenance code from code coverage reports

https://gerrit.wikimedia.org/r/1067329

Change #1066707 merged by jenkins-bot:

[mediawiki/core@master] Test purgeOldText.php

https://gerrit.wikimedia.org/r/1066707

Change #1063756 merged by jenkins-bot:

[mediawiki/core@master] Test deleteOldRevisions.php

https://gerrit.wikimedia.org/r/1063756

Change #1063757 merged by jenkins-bot:

[mediawiki/core@master] Test checkComposerLockUpToDate.php

https://gerrit.wikimedia.org/r/1063757

Change #1066706 merged by jenkins-bot:

[mediawiki/core@master] Test moveBatch.php

https://gerrit.wikimedia.org/r/1066706

Change #1066705 merged by jenkins-bot:

[mediawiki/core@master] Test jsparse.php

https://gerrit.wikimedia.org/r/1066705

Change #1069246 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Start on tests for resetAuthenticationThrottle.php

https://gerrit.wikimedia.org/r/1069246

Change #1069247 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Start on tests for renameUser.php

https://gerrit.wikimedia.org/r/1069247

Change #1069248 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test dumpRev.php

https://gerrit.wikimedia.org/r/1069248

Change #1069256 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Fully test createBotPassword.php

https://gerrit.wikimedia.org/r/1069256

Change #1069268 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test deleteOrphanedRevisions.php

https://gerrit.wikimedia.org/r/1069268

Change #1069246 merged by jenkins-bot:

[mediawiki/core@master] Start on tests for resetAuthenticationThrottle.php

https://gerrit.wikimedia.org/r/1069246

Change #1069247 merged by jenkins-bot:

[mediawiki/core@master] Start on tests for renameUser.php

https://gerrit.wikimedia.org/r/1069247

Change #1061453 merged by jenkins-bot:

[mediawiki/core@master] Test fixUserRegistration.php

https://gerrit.wikimedia.org/r/1061453

Change #1069248 merged by jenkins-bot:

[mediawiki/core@master] Test dumpRev.php

https://gerrit.wikimedia.org/r/1069248

Change #1069268 merged by jenkins-bot:

[mediawiki/core@master] Test deleteOrphanedRevisions.php

https://gerrit.wikimedia.org/r/1069268

Change #1069256 merged by jenkins-bot:

[mediawiki/core@master] Fully test createBotPassword.php

https://gerrit.wikimedia.org/r/1069256

Change #1063752 merged by jenkins-bot:

[mediawiki/core@master] Start on tests for install.php

https://gerrit.wikimedia.org/r/1063752

Change #1069963 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test makeTestEdits.php

https://gerrit.wikimedia.org/r/1069963

Change #1069964 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test changePassword.php

https://gerrit.wikimedia.org/r/1069964

Change #1069965 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Mark FakeMaintenance as excluded for test coverage

https://gerrit.wikimedia.org/r/1069965

Change #1069966 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test getReplicaServer.php

https://gerrit.wikimedia.org/r/1069966

Change #1069967 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test runJobs.php

https://gerrit.wikimedia.org/r/1069967

Change #1069968 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test parse.php

https://gerrit.wikimedia.org/r/1069968

Change #1069969 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test userOptions.php

https://gerrit.wikimedia.org/r/1069969

Change #1069970 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test grep.php

https://gerrit.wikimedia.org/r/1069970

Change #1069971 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test updateExtensionJsonSchema.php

https://gerrit.wikimedia.org/r/1069971

Change #1069972 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test validateRegistrationFile.php

https://gerrit.wikimedia.org/r/1069972

Change #1069973 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Fix broken deleteSelfExternals.php and test it

https://gerrit.wikimedia.org/r/1069973

Change #1069974 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test LoggedUpdateMaintenance

https://gerrit.wikimedia.org/r/1069974

Change #1069975 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test alltrans.php and dumpMessages.php

https://gerrit.wikimedia.org/r/1069975

Change #1069976 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Move BenchmarkerTest and MaintenanceTest into includes folder

https://gerrit.wikimedia.org/r/1069976

Change #1069977 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Remove unreachable default branch in getConfiguration.php

https://gerrit.wikimedia.org/r/1069977

Change #1069978 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand CleanupWatchlistTest

https://gerrit.wikimedia.org/r/1069978

Change #1069979 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand GetLagTimesTest

https://gerrit.wikimedia.org/r/1069979

Change #1069980 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand ResetUserEmailTest

https://gerrit.wikimedia.org/r/1069980

Change #1069981 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand ProtectTest

https://gerrit.wikimedia.org/r/1069981

Change #1069982 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand GetTextMaintTest

https://gerrit.wikimedia.org/r/1069982

Change #1069984 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand MigrateUserGroupTest

https://gerrit.wikimedia.org/r/1069984

Change #1069985 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand RollbackEditsTest

https://gerrit.wikimedia.org/r/1069985

Change #1069977 abandoned by Dreamy Jazz:

[mediawiki/core@master] Remove unreachable default branch in getConfiguration.php

Reason:

It was just to improve coverage for the file, but you raise a good point so I'll abandon this.

https://gerrit.wikimedia.org/r/1069977

Change #1069965 merged by jenkins-bot:

[mediawiki/core@master] Mark FakeMaintenance as excluded for test coverage

https://gerrit.wikimedia.org/r/1069965

Change #1069974 merged by jenkins-bot:

[mediawiki/core@master] Test LoggedUpdateMaintenance

https://gerrit.wikimedia.org/r/1069974

Change #1069967 merged by jenkins-bot:

[mediawiki/core@master] Test runJobs.php

https://gerrit.wikimedia.org/r/1069967

Change #1069966 merged by jenkins-bot:

[mediawiki/core@master] Test getReplicaServer.php

https://gerrit.wikimedia.org/r/1069966

Change #1069968 merged by jenkins-bot:

[mediawiki/core@master] Test parse.php

https://gerrit.wikimedia.org/r/1069968

Change #1069963 merged by jenkins-bot:

[mediawiki/core@master] Test makeTestEdits.php

https://gerrit.wikimedia.org/r/1069963

Change #1069964 merged by jenkins-bot:

[mediawiki/core@master] Test changePassword.php

https://gerrit.wikimedia.org/r/1069964

Change #1069972 merged by jenkins-bot:

[mediawiki/core@master] Test validateRegistrationFile.php

https://gerrit.wikimedia.org/r/1069972

Change #1069981 merged by jenkins-bot:

[mediawiki/core@master] Expand ProtectTest

https://gerrit.wikimedia.org/r/1069981

Change #1069979 abandoned by Dreamy Jazz:

[mediawiki/core@master] Expand GetLagTimesTest

Reason:

Considering the -1, I'll abandon this and potentially re-create it at a later date.

https://gerrit.wikimedia.org/r/1069979

Change #1069978 merged by jenkins-bot:

[mediawiki/core@master] Expand CleanupWatchlistTest

https://gerrit.wikimedia.org/r/1069978

Change #1069982 merged by jenkins-bot:

[mediawiki/core@master] Expand GetTextMaintTest

https://gerrit.wikimedia.org/r/1069982

Change #1069985 merged by jenkins-bot:

[mediawiki/core@master] Expand RollbackEditsTest

https://gerrit.wikimedia.org/r/1069985

Change #1069975 merged by jenkins-bot:

[mediawiki/core@master] Test alltrans.php and dumpMessages.php

https://gerrit.wikimedia.org/r/1069975

Change #1069971 merged by jenkins-bot:

[mediawiki/core@master] Start on tests for updateExtensionJsonSchema.php

https://gerrit.wikimedia.org/r/1069971

Change #1069976 merged by jenkins-bot:

[mediawiki/core@master] Move BenchmarkerTest and MaintenanceTest into includes folder

https://gerrit.wikimedia.org/r/1069976

Change #1069984 merged by jenkins-bot:

[mediawiki/core@master] Expand MigrateUserGroupTest

https://gerrit.wikimedia.org/r/1069984

Change #1069980 merged by jenkins-bot:

[mediawiki/core@master] Expand ResetUserEmailTest

https://gerrit.wikimedia.org/r/1069980

Change #1069969 merged by jenkins-bot:

[mediawiki/core@master] Start on tests for userOptions.php

https://gerrit.wikimedia.org/r/1069969

Change #1069970 merged by jenkins-bot:

[mediawiki/core@master] Test grep.php

https://gerrit.wikimedia.org/r/1069970

Change #1069973 merged by jenkins-bot:

[mediawiki/core@master] Fix broken deleteSelfExternals.php and test it

https://gerrit.wikimedia.org/r/1069973

Change #1072811 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Partly test deleteTag.php

https://gerrit.wikimedia.org/r/1072811

Change #1073180 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test exportSites.php and importSites.php

https://gerrit.wikimedia.org/r/1073180

Change #1073181 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test findDeprecated.php

https://gerrit.wikimedia.org/r/1073181

Change #1072811 merged by jenkins-bot:

[mediawiki/core@master] Partly test deleteTag.php

https://gerrit.wikimedia.org/r/1072811

Change #1073180 merged by jenkins-bot:

[mediawiki/core@master] Test exportSites.php and importSites.php

https://gerrit.wikimedia.org/r/1073180

Change #1078747 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand tests for rename user maintenance scripts

https://gerrit.wikimedia.org/r/1078747

Change #1078747 merged by jenkins-bot:

[mediawiki/core@master] Expand tests for rename user maintenance scripts

https://gerrit.wikimedia.org/r/1078747

Change #1079222 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Expand CreateAndPromoteTest

https://gerrit.wikimedia.org/r/1079222

Change #1079222 merged by jenkins-bot:

[mediawiki/core@master] Expand CreateAndPromoteTest

https://gerrit.wikimedia.org/r/1079222

Change #1079964 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Add tests for deleteEqualMessages.php

https://gerrit.wikimedia.org/r/1079964

Change #1079965 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test patchSql.php

https://gerrit.wikimedia.org/r/1079965

Change #1079966 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test purgePage.php

https://gerrit.wikimedia.org/r/1079966

Change #1079965 merged by jenkins-bot:

[mediawiki/core@master] Test patchSql.php

https://gerrit.wikimedia.org/r/1079965

Change #1079966 merged by jenkins-bot:

[mediawiki/core@master] Test purgePage.php

https://gerrit.wikimedia.org/r/1079966

Change #1079964 merged by jenkins-bot:

[mediawiki/core@master] Add tests for deleteEqualMessages.php

https://gerrit.wikimedia.org/r/1079964

Change #1073181 merged by jenkins-bot:

[mediawiki/core@master] Test findDeprecated.php

https://gerrit.wikimedia.org/r/1073181

Change #1087127 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test addSite.php

https://gerrit.wikimedia.org/r/1087127

Change #1087128 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test SchemaMaintenance

https://gerrit.wikimedia.org/r/1087128

Change #1087128 merged by jenkins-bot:

[mediawiki/core@master] Test SchemaMaintenance

https://gerrit.wikimedia.org/r/1087128

Change #1087127 merged by jenkins-bot:

[mediawiki/core@master] Test addSite.php

https://gerrit.wikimedia.org/r/1087127

Update as of 2024-11-06 is that this is now up nearly five-fold, to 23.44% (by comparison, includes/ is 44.05%. Do we have a target for "good enough" so we can close this, or is it doomed to be forever open? :-)

Do we have a target for "good enough" so we can close this, or is it doomed to be forever open? :-)

Hmm. I don't have anything specific in mind. Perhaps at 44% it would definitely be resolved, and possibly sooner if I don't see any other maintenance scripts that are not too complicated to write tests for.

Looking at other similar "test coverage is very low, increase please" tickets, I've seen anything from 35% to 90%.

Change #1087994 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test invalidateUserSessions.php

https://gerrit.wikimedia.org/r/1087994

Change #1087995 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test initSiteStats.php

https://gerrit.wikimedia.org/r/1087995

Change #1087994 merged by jenkins-bot:

[mediawiki/core@master] Test invalidateUserSessions.php

https://gerrit.wikimedia.org/r/1087994

Change #1087995 merged by jenkins-bot:

[mediawiki/core@master] Test initSiteStats.php

https://gerrit.wikimedia.org/r/1087995

Change #1088563 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Test initUserPreference.php and fix a bug with it

https://gerrit.wikimedia.org/r/1088563

Change #1088563 merged by jenkins-bot:

[mediawiki/core@master] Test initUserPreference.php and fix a bug with it

https://gerrit.wikimedia.org/r/1088563