Page MenuHomePhabricator

DifferenceEngineTest::testMapDiffPrevNext fails when run standalone in CI / Quibble context
Closed, ResolvedPublic

Description

Problem

The DifferenceEngineTest::testMapDiffPrevNext test fails if the DifferenceEngineTest class is run standalone in a Quibble / CI test context. The test fails with the message:

1) DifferenceEngineTest::testShowDiffPage with data set "missing prev" (array('rev[0]', 'prev'), array('read'), array('\(diff-empty\).*<div class="m...ittens'))
OOUI\Exception: OOUI\Theme::singleton was called with no singleton theme set. in /workspace/src/vendor/oojs/oojs-ui/php/Theme.php:31

Steps to reproduce

  1. Open the Quibble shell by launching quibble and passing -c bash as the test command (see docs)
  2. Run the DifferenceEngineTest class on its own

Observed behaviour
The test run fails:

$  composer run --timeout=0 phpunit:entrypoint -- ./tests/phpunit/includes/diff/DifferenceEngineTest.php
> phpunit './tests/phpunit/includes/diff/DifferenceEngineTest.php'
Using PHP 7.4.33
Running with MediaWiki settings because there might be integration tests
PHPUnit 9.6.16 by Sebastian Bergmann and contributors.

......................................E..........                 49 / 49 (100%)
Time: 00:01.073, Memory: 111.00 MB

There was 1 error:

1) DifferenceEngineTest::testShowDiffPage with data set "missing prev" (array('rev[0]', 'prev'), array('read'), array('\(diff-empty\).*<div class="m...ittens'))
OOUI\Exception: OOUI\Theme::singleton was called with no singleton theme set. in /workspace/src/vendor/oojs/oojs-ui/php/Theme.php:31
Stack trace:
#0 /workspace/src/vendor/oojs/oojs-ui/php/Element.php(259): OOUI\Theme::singleton()
...

Expected Behaviour
The tests should pass.

Event Timeline

Seems to be similar to the issue in T360631 - adding $out->enableOOUI(); seems to be enough to resolve the issue. Apparently the test runs otherwise rely on other classes having called enableOOUI() first.

Change #1025671 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/core@master] Make DifferenceEngineTest run standalone

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

Change #1025671 merged by jenkins-bot:

[mediawiki/core@master] Make DifferenceEngineTest run standalone

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