Page MenuHomePhabricator

Fix test failures for CheckUser when temporary accounts are enabled
Closed, ResolvedPublic1 Estimated Story Points

Description

Split from T357974: Update CheckUser interfaces to autocreate a temporary account if an IP is running a check and temporary accounts are enabled

When temporary accounts are enabled the CheckUser extension integration tests fail because the code attempts to create an actor ID for IP addresses (as this is the default user for integration tests in the request context). The code does not fail with this at the moment as the rights checks are done at the interface side and these tests are testing code that is gated after the user rights checks.

Setting the default user to a user with just the checkuser and/or checkuser-log rights should both prevent issues and avoid using a user which doesn't have the rights to get to this code (even though the tests skip the user rights checking part of the code by directly calling the relevant methods for testing).

Acceptance criteria
  • Tests for CheckUser when temporary accounts are enabled should pass

Event Timeline

Dreamy_Jazz changed the point value for this task from 2 to 1.Feb 21 2024, 8:57 PM

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

[mediawiki/extensions/CheckUser@master] Use a registered user as the context user in CheckUser tests

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

As this change only modified test files, I propose that no QA is needed and I'm moving this to Done.

Change 1005599 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Use a registered user as the context user in CheckUser tests

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