Page MenuHomePhabricator

SpecialCreateTopicPageTest.php fails when run with ChangeFileInfoFormTest.php and ApiFlowEditTopicSummaryTest.php
Closed, ResolvedPublic

Description

Problem

extensions/ArticlePlaceholder/tests/phpunit/includes/specials/SpecialCreateTopicPageTest.php has PHPUnit test failures when run in a suite with extensions/FileImporter/tests/phpunit/Html/ChangeFileInfoFormTest.php and extensions/Flow/tests/phpunit/Api/ApiFlowEditTopicSummaryTest.php. 1 test fails:

1) ArticlePlaceholder\Tests\Specials\SpecialCreateTopicPageTest::testExecute with data set #1 (true, '')
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()
#1 /workspace/src/vendor/oojs/oojs-ui/php/Tag.php(510): OOUI\Element->toString()
#2 [internal function]: OOUI\Tag->__toString()

Steps to reproduce
In a Mediawiki checkout with the ArticlePlaceholder, Flow and FileImporter extensions installed.

  1. Copy phpunit.dist.xml to phpunit.xml
  2. Add a test suite with the following two tests:
<testsuite name="failing_group">
  <file>extensions/Flow/tests/phpunit/Api/ApiFlowEditTopicSummaryTest.php</file>
  <file>extensions/FileImporter/tests/phpunit/Html/ChangeFileInfoFormTest.php</file>
  <file>extensions/ArticlePlaceholder/tests/phpunit/includes/specials/SpecialCreateTopicPageTest.php</file>
</testsuite>
  1. Run the named test suite:
mw docker mediawiki exec -- composer run phpunit:entrypoint -- --testsuite failing_group

Observed behaviour
The test run fails

Expected behaviour
The tests pass

Event Timeline

The failure here looks very similar to the issue in T363797 . I wonder if there is a general solution for the OOUI\Theme::singleton issue.

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

[mediawiki/extensions/FileImporter@master] Reset OOUI fully after ChangeFileInfoFormTest

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

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

[mediawiki/extensions/TwoColConflict@master] Setup OOUI instead of using blank theme in tests

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

Change #1043682 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Drop all extra setupOOUI calls

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

Change #1043684 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TwoColConflict@master] Drop all Theme::setSingleton calls from tests

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

Change #1043049 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Setup OOUI instead of using blank theme in tests

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

Change #1043682 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Drop all extra setupOOUI calls

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

Change #1043684 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/TwoColConflict@master] Drop all Theme::setSingleton calls from tests

Reason:

See Icb6901f.

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

Change #1043676 merged by jenkins-bot:

[mediawiki/extensions/TwoColConflict@master] Setup OOUI instead of using blank theme in tests

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