Page MenuHomePhabricator

WikimedaIncubator extension is incompatible with the autopatrol API tests added to MediaWiki core
Open, Needs TriagePublic

Description

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/2772/console

00:01:53.324 > @ api-testing /workspace/src
00:01:53.324 > mocha --timeout 0 --recursive tests/api-testing
00:01:53.324 
00:01:54.142 
00:01:54.144 
00:01:54.145   Testing default autopatrolling rights
00:01:54.390 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50418 [200]: /api.php?format=json&action=query&meta=tokens&type=login
00:01:54.740 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50420 [200]: /api.php
00:01:54.757 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50422 [200]: /api.php?format=json&action=query&meta=tokens&type=createaccount%7Cuserrights%7Ccsrf
00:01:54.768 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50424 [200]: /api.php?format=json&action=query&meta=tokens&type=createaccount
00:01:55.003 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50426 [200]: /api.php
00:01:55.034 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50428 [200]: /index.php
00:01:55.070 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50430 [200]: /api.php
00:01:55.084 INFO:backend.DevWebServer:[Fri Jan 10 23:33:19 2020] 127.0.0.1:50432 [200]: /api.php?format=json&action=query&meta=tokens&type=login
00:01:55.367 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50434 [200]: /api.php
00:01:55.379 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50436 [200]: /api.php?format=json&action=query&meta=tokens&type=userrights%7Ccsrf
00:01:55.416 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50438 [200]: /api.php
00:01:55.419     1) should edit page as a user in autopatrol group
00:01:55.428 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50440 [200]: /api.php?format=json&action=query&meta=tokens&type=csrf
00:01:55.443 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50442 [200]: /api.php
00:01:55.444     2) should edit page as an anonymous user
00:01:55.453 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50444 [200]: /api.php?format=json&action=query&meta=userinfo
00:01:55.467 INFO:backend.DevWebServer:[Fri Jan 10 23:33:20 2020] 127.0.0.1:50446 [200]: /api.php?format=json&action=query&list=recentchanges&rctitle=Autopatrol_XxVVDoNT8W&rcprop=patrolled%7Cuser
00:01:55.473     3) should confirm autopatrolling rights
00:01:55.474 
00:01:55.474 
00:01:55.477   0 passing (1s)
00:01:55.477   3 failing
00:01:55.479 
00:01:55.480   1) Testing default autopatrolling rights
00:01:55.480        should edit page as a user in autopatrol group:
00:01:55.480      AssertionError: User "Mindyv79eFbIhA7": Action "edit" returned error code "wminc-error-unprefixed": Error: This page is [[Help:Contents|unprefixed]].!
00:01:55.480       at Client.action (node_modules/api-testing/lib/actionapi.js:114:20)
00:01:55.480       at process._tickCallback (internal/process/next_tick.js:68:7)
00:01:55.480 
00:01:55.480   2) Testing default autopatrolling rights
00:01:55.480        should edit page as an anonymous user:
00:01:55.480      AssertionError: User "<anon>": Action "edit" returned error code "wminc-error-unprefixed": Error: This page is [[Help:Contents|unprefixed]].!
00:01:55.480       at Client.action (node_modules/api-testing/lib/actionapi.js:114:20)
00:01:55.480       at process._tickCallback (internal/process/next_tick.js:68:7)
00:01:55.480 
00:01:55.480   3) Testing default autopatrolling rights
00:01:55.480        should confirm autopatrolling rights:
00:01:55.480 
00:01:55.480       AssertionError: expected [] to have a length of 2 but got 0
00:01:55.480       + expected - actual
00:01:55.480 
00:01:55.480       -0
00:01:55.480       +2
00:01:55.480       
00:01:55.480       at Context.it (tests/api-testing/action/Autopatrolling.js:24:10)
00:01:55.480       at process._tickCallback (internal/process/next_tick.js:68:7)

WikimediaIncubator fiddles with namespaces quite a lot, so this is unsurprising.

Event Timeline

The way to fix this would be to add a dummy prefix like "Wp/qqt/" to the page name in the test. What's the best way to do that?

Another solution I just thought of would be to set the "test wiki" setting for the user in question to "inc" ("Maintenance"); this lets a user create/edit pages that doesn't have a prefix.

This is done in the API with api.php?action=options&format=json&optionname=incubatortestwiki-project&optionvalue=inc&token=<token>.