Page MenuHomePhabricator

parser tests running under phpunit are broken in extensions
Closed, InvalidPublic

Description

Extension BlueSpiceSocial fails on Cite parser tests due to missing template

https://integration.wikimedia.org/ci/job/quibble-composer-mysql-php72-docker/13033/console

15:50:49 There were 32 failures:
15:50:49 
15:50:49 1) ParserIntegrationTest::testParse with data set "citeParserTests.txt: <ref> with a simple template" ('[details omitted]')
15:50:49 === Logs generated by test case
15:50:49 [wfDebug] [debug] ParserTestRunner::runTest: running <ref> with a simple template {"private":false}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BsGenericTagExtensionHandler::setupHandlers {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
15:50:49 [MessageCache] [debug] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database []
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\ServicesDecorator::getInstance {"private":true}
15:50:49 [bluespice-deprecations] [info] BlueSpice\Services::getBSEntityFactory {"private":true}
15:50:49 ===
15:50:49 Failed asserting that two strings are equal.
15:50:49 --- Expected
15:50:49 +++ Actual
15:50:49 @@ @@
15:50:49  '<p>Templating<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup>\n
15:50:49  </p>\n
15:50:49  <div class="mw-references-wrap"><ol class="references">\n
15:50:49 -<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">A <i>simple</i> template.</span>\n
15:50:49 +<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><a href="/wiki/Template:Simple_template" title="Template:Simple template">Template:Simple template</a></span>\n
15:50:49  </li>\n
15:50:49  </ol></div>'
15:50:49 
15:50:49 /workspace/src/tests/phpunit/suites/ParserIntegrationTest.php:64
15:50:49 /workspace/src/tests/phpunit/suites/SuiteEventsTrait.php:25
15:50:49 /workspace/src/tests/phpunit/suites/SuiteEventsTrait.php:25
15:50:49 /workspace/src/maintenance/doMaintenance.php:99

Templates defined as article in the parser tests files are not found by the parser test

Event Timeline

I don't know if this is the same thing, today I have seen multiple times for this patch:

 There were 222 failures:

12:26:39 1) ParserIntegrationTest::testParse with data set "bookReferencing.txt: Book Referencing attribute rejected by default" ('[details omitted]')
12:26:39 HttpRequestFactory not supported
12:26:39 
12:26:39 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:1077
12:26:39 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:447
12:26:39 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:416
12:26:39 /workspace/src/includes/MediaWikiServices.php:793
12:26:39 /workspace/src/extensions/GrowthExperiments/ServiceWiring.php:58
12:26:39 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:447
12:26:39 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:416
12:26:39 /workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:424
12:26:39 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory.php:161
12:26:39 /workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory.php:102
12:26:39 /workspace/src/includes/HookContainer/HookContainer.php:463
12:26:39 /workspace/src/includes/HookContainer/HookContainer.php:159
12:26:39 /workspace/src/includes/HookContainer/HookRunner.php:2578
12:26:39 /workspace/src/includes/cache/MessageCache.php:929
12:26:39 /workspace/src/includes/language/Message.php:1291
12:26:39 /workspace/src/includes/language/Message.php:1013
12:26:39 /workspace/src/extensions/Cite/src/FootnoteMarkFormatter.php:101
12:26:39 /workspace/src/extensions/Cite/src/FootnoteMarkFormatter.php:60
12:26:39 /workspace/src/extensions/Cite/src/Cite.php:373
12:26:39 /workspace/src/extensions/Cite/src/Cite.php:129
12:26:39 /workspace/src/extensions/Cite/src/Hooks/CiteParserTagHooks.php:41
12:26:39 /workspace/src/includes/parser/Parser.php:3925
12:26:39 /workspace/src/includes/parser/PPFrame_Hash.php:330
12:26:39 /workspace/src/includes/parser/Parser.php:2874
12:26:39 /workspace/src/includes/parser/Parser.php:1547
12:26:39 /workspace/src/includes/parser/Parser.php:646
12:26:39 /workspace/src/tests/parser/ParserTestRunner.php:915
12:26:39 /workspace/src/tests/phpunit/suites/ParserIntegrationTest.php:60
12:26:39 /workspace/src/tests/phpunit/suites/SuiteEventsTrait.php:25
12:26:39 /workspace/src/tests/phpunit/suites/SuiteEventsTrait.php:25
12:26:39 /workspace/src/maintenance/doMaintenance.php:106
12:26:39 === Logs generated by test case
12:26:39 [wfDebug] [debug] ParserTestRunner::runTest: running Book Referencing attribute rejected by default {"private":false}
12:26:39 [wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
12:26:39 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
12:26:39 ===
kostajh triaged this task as High priority.Oct 7 2020, 2:01 PM

None of the patches for GrowthExperiments pass CI because of this. Does anyone have ideas on what caused this problem?

None of the patches for GrowthExperiments pass CI because of this. Does anyone have ideas on what caused this problem?

Through our circuitous dependency tree GrowthExperiments requires PageViewInfo which requires Graph which requires JsonConfig which requires Kartographer which requires ParserFunctions -- which hasn't been touched in a long time it seems. Looks like https://gerrit.wikimedia.org/r/c/mediawiki/core/+/626348 merged yesterday: adding @daniel and @Jdforrester-WMF

Argh, sorry about this. Daniel's patch also caused T264849 in (the non-gated part of) Wikibase-land. :-(

Hmm, no, this isn't an HTTP change? This is just bitrot from the new-ish Cite feature, it looks like?

OK, so, rechecks on the master branches of both Cite (where the error is coming from?) and ParserFunctions (fingered above) come back clean. Not sure what else it could be?

I think this is due to the HTTP change in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/626348. For some reason GrowthExperiments GrowthExperimentsConfigurationLoader service is triggered by a hook, and since we haven't mocked the HTTP request factory, the tests fail. I'm working on it in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/632890

And yeah, this is different issue than what was reported here. Sorry for the noise. I made T265024 for this one.

Not sure where this one is today, but if we're still in a broken state we need new analysis since so much has changed.