Page MenuHomePhabricator

mediawiki.api.js tests fails with $wgDebugToolbar = true and/or $wgDebugAPI = true
Closed, DeclinedPublic

Description

Setting $wgDebugToolbar = true in LocalSettings will break one qunit test:

mediawiki.api: Basic functionality

With the toolbar each api response has a 'debuginfo' section, but the test asume a empty result.


Version: unspecified
Severity: enhancement

Details

Reference
bz50009

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:51 AM
bzimport set Reference to bz50009.
bzimport added a subscriber: Unknown Object (MLST).

wgDebugToolbar causes all kinds of issues in the front-end due to overlapping of the interface and what not.

I think it is poor design that it injects such property in API responses. If you want such information from the API, perhaps it should be a special format (e.g. format=debug) instead of injecting an undocumented parameter in all responses.

wgDebugToolbar works for the api in the same way as for the gui: it added unconditionally the text which was passed to wfDebug and so on.

$wgDebugAPI = true always sets a warning, which gives also false positive

Change 110894 had a related patch set uploaded by Alex Monk:
Fix API QUnit tests that are not aware of wgDebugToolbar

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

That patch doesn't deal with wgDebugAPI... Not sure there's a nice clean way to do it really...

Change 110894 abandoned by Krinkle:
Fix API QUnit tests that are not aware of wgDebugToolbar

Reason:
This is obsolete now that we've taken the more elegant route of not relying on the server in the first place and limiting the test to testing the client-side logic. Whether it should account for wgDebugToolbar is separate question still, but at least the QUnit run won't be affected by that.

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

As of I20b17f256bc5114c6c2c3185653 we no longer interact with api.php from our unit tests, so this bug has become obsolete.