Page MenuHomePhabricator

Fully test Hooks.php / HookHandlers
Closed, ResolvedPublic

Description

Hooks.php and the HookHandlers are one of the more critical groups of files in CheckUser. Issues from it are more likely to affect more than just CheckUsers, as the handlers are called in many more places than just CheckUser (including edits and page views on certain pages). Fully testing the Hooks.php file and other handlers will ensure that patches are properly tested and therefore also encourage testing new additions to keep the high coverage.

Event Timeline

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

[mediawiki/extensions/CheckUser@master] Add multiple integration tests for Hooks.php

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

Change 824746 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add multiple integration tests for Hooks.php

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

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

[mediawiki/extensions/CheckUser@master] Add multiple integration tests for Hooks.php

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

Change 843927 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add multiple integration tests for Hooks.php

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

Dreamy_Jazz moved this task from Patches for review to General / Unsorted on the CheckUser board.

Adding selenium tests that check for a end-to-end logging of a checkuser action makes sense to me. For example:

  • Selenium test logs in to an account
  • Selenium test runs a check on that account
  • Verifies that the last shown row for that account was as expected (in this case is a login row).

Having the structured data change would be useful here as classes could be applied for what the action is, making testing that it's the "correct" action easier as it could just be a class check.

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

[mediawiki/extensions/CheckUser@master] Integration test Hooks::onAuthManagerLoginAuthenticateAudit

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

Change 850270 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Integration test Hooks::onAuthManagerLoginAuthenticateAudit

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

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

[mediawiki/extensions/CheckUser@master] Split maybePruneIPData and then test newly created pruneIPData

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

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

[mediawiki/extensions/CheckUser@master] Test Hooks::onUserToolLinksEdit

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

Change 873051 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Split maybePruneIPData and then test newly created pruneIPData

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

Change 873084 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Test Hooks::onUserToolLinksEdit

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

Dreamy_Jazz renamed this task from Fully test Hooks.php to Fully test Hooks.php / HookHandlers.Jun 8 2023, 12:48 PM
Dreamy_Jazz updated the task description. (Show Details)

Change 928527 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move Hooks::onRenameUserSQL to hook handler file and unit test

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

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

[mediawiki/extensions/CheckUser@master] Move Hooks::onSpecialPage_initList to a hook handler file

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

Change 928553 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move Hooks::onSpecialPage_initList to a hook handler file

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

Going to mark this as resolved, given that the test coverage is nearly full based on https://doc.wikimedia.org/cover-extensions/CheckUser/src/Hooks.php.html