Page MenuHomePhabricator

Permission checks fails in some tests
Closed, ResolvedPublic


It seems like the $wgUser is sometimes set to group wbeditor and sometimes to sysop. When it is set to sysop testing of permissions will sometimes fail because of failed assumptions.

A typical run where this bug shows up is for group Wikibase and gives six failures in testCheckPermission and testUserCan. Other groups, or combinations of groups, will give other permission related errors.

It is available a workaround in Change Iaa705f72: "Workaround for failing tests", but any tests that manipulates the $wgUser should save previous state and restore it on exit. The tests for EditEntity seems to do this right (saved in $userGroups) but EditContentTest and subclasses seems to fail on this. When the method testCheckPermission or testUserCan is called the permission checks are triggered, and then they will fail sometimes because the user is either a sysop or wbeditor and they have different rights.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:04 AM
bzimport set Reference to bz42526.

The workaround fixes the 6 failing tests when running --group WikibaseRepo but it does not fix all the other (~44) permission-failures when running --group DataValueExtensions,Wikibase

I assume there is a similar problem.

EditContentTest and subclasses do get it right, but somehow it still fails

I8705a27f fixes 41 of 44 failures

(In reply to comment #3)

I8705a27f fixes 41 of 44 failures

Status Merged

Verified in Wikidata demo sprint 26

Restricted Application added a subscriber: StudiesWorld. · View Herald Transcript