Page MenuHomePhabricator

Cite parser test failure due to hard dependancy on ParserFunctions
Closed, ResolvedPublic

Description

/var/www/wiki-1.35/core/extensions/Cite/tests/parser/citeSmokeTests.txt:101
--- /tmp/mwParser-expectedIJocu8	2023-06-25 13:56:59.375498903 +0100
+++ /tmp/mwParser-actualsfTOEU	2023-06-25 13:56:59.375498903 +0100
@@ -1,5 +1,5 @@
 <p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup>
-false or error
+{{#ifeq: {{#expr: string &lt; 5 }} | 1 | true | false or error }}
 </p>
 <div class="mw-references-wrap"><ol class="references">
 <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">something</span>
Running test It should be impossible to roll back a follow="…", because it can't have a name... PASSED
Running test It should be impossible to roll back a follow="…", because it must have a name... PASSED

Running parser tests from "/var/www/wiki-1.35/core/extensions/Cite/tests/parser/responsiveReferences.txt"...
Running test Ordered lists directly following each other should not be merged... PASSED
Running test Enabling responsive references by default should add a <div> wrapper... PASSED
Running test Enabling responsive references in the tag should add a <div> wrapper... PASSED
Running test Disabling responsive references in the tag should remove the <div> wrapper... PASSED
Running test T241303: responsive attribute with no value should *not* disable the wrapper <div>... PASSED
Running test T241303: responsive attribute with an empty value should *not* disable the wrapper <div>... PASSED
Running test 9 references should *not* enable the column mode... PASSED
Running test 10 references should enable the column mode... PASSED

Passed 1751 of 1752 tests (99.94%)... 1 tests failed!

If I enable ParserFunctions in LocalSettings this then passes...

Event Timeline

Reedy renamed this task from Cite parser test failure on REL1_35 to Cite parser test failure on REL1_35 due to hard dependancy on ParserFunctions.Jun 25 2023, 1:00 PM
Reedy triaged this task as Low priority.
Reedy updated the task description. (Show Details)
Reedy renamed this task from Cite parser test failure on REL1_35 due to hard dependancy on ParserFunctions to Cite parser test failure due to hard dependancy on ParserFunctions.Jun 25 2023, 2:08 PM
Reedy added a project: MW-1.38-release.

Change 932637 had a related patch set uploaded (by Reedy; author: C. Scott Ananian):

[mediawiki/extensions/Cite@REL1_38] parser tests: move test which requires {{#ifeq}} into its own file

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

Change 932638 had a related patch set uploaded (by Reedy; author: C. Scott Ananian):

[mediawiki/extensions/Cite@REL1_35] parser tests: move test which requires {{#ifeq}} into its own file

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

Change 932637 merged by jenkins-bot:

[mediawiki/extensions/Cite@REL1_38] parser tests: move test which requires {{#ifeq}} into its own file

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

REL1_38 was a simple cherry pick...

REL1_35 is more complex, due to tests/parser/TestFileReader.php changes in REL1_36+

15:19:02 MWException from line 328 of /workspace/src/tests/parser/TestFileReader.php: 'end' without '' at line 5 of /workspace/src/extensions/Cite/tests/parser/citeSmokeTests2.txt
15:19:02 
15:19:02 #0 /workspace/src/tests/parser/TestFileReader.php(263): TestFileReader->checkSection(Array)
15:19:02 #1 /workspace/src/tests/parser/TestFileReader.php(40): TestFileReader->execute()
15:19:02 #2 /workspace/src/tests/phpunit/suites/ParserTestFileSuite.php(21): TestFileReader::read('/workspace/src/...')
15:19:02 #3 /workspace/src/tests/phpunit/suites/ParserTestTopLevelSuite.php(140): ParserTestFileSuite->__construct(Object(ParserTestRunner), 'ParserTest_Cite...', '/workspace/src/...')
15:19:02 #4 /workspace/src/tests/phpunit/suites/ParserTestTopLevelSuite.php(70): ParserTestTopLevelSuite->__construct(2)
15:19:02 #5 /workspace/src/tests/phpunit/suites/ExtensionsParserTestSuite.php(8): ParserTestTopLevelSuite::suite(2)
15:19:02 #6 [internal function]: ExtensionsParserTestSuite::suite('ExtensionsParse...')
15:19:02 #7 /workspace/src/vendor/phpunit/phpunit/src/Framework/TestSuite.php(455): ReflectionMethod->invoke(NULL, 'ExtensionsParse...')
15:19:02 #8 /workspace/src/vendor/phpunit/phpunit/src/Util/Configuration.php(1061): PHPUnit\Framework\TestSuite->addTestFile('/workspace/src/...')
15:19:02 #9 /workspace/src/vendor/phpunit/phpunit/src/Util/Configuration.php(907): PHPUnit\Util\Configuration->getTestSuite(Object(DOMElement), Array)
15:19:02 #10 /workspace/src/vendor/phpunit/phpunit/src/TextUI/Command.php(963): PHPUnit\Util\Configuration->getTestSuiteConfiguration('extensions')
15:19:02 #11 /workspace/src/vendor/phpunit/phpunit/src/TextUI/Command.php(202): PHPUnit\TextUI\Command->handleArguments(Array)
15:19:02 #12 /workspace/src/tests/phpunit/phpunit.php(75): PHPUnit\TextUI\Command->run(Array, true)
15:19:02 #13 /workspace/src/maintenance/doMaintenance.php(107): PHPUnitMaintClass->execute()
15:19:02 #14 /workspace/src/tests/phpunit/phpunit.php(134): require('/workspace/src/...')
15:19:02 #15 {main}

Filed T340392: Document requirements options attribute in https://www.mediawiki.org/wiki/Manual:Parser_tests as requirements= isn't documented...

File T340393: Poor error reporting by TestFileReader in REL1_35 for the poor error handling...

@cscott Any ideas on how to make this work for REL1_35?

MW 1.35 is EOL in a few months, so I'm not fussed about fixing this if it's a non trivial amount of effort....

We can just leave it broken (not a big deal), or just move it to a seperate file and comment out... Or delete the test...

@cscott Any ideas on how to make this work for REL1_35?

MW 1.35 is EOL in a few months, so I'm not fussed about fixing this if it's a non trivial amount of effort....

We can just leave it broken (not a big deal), or just move it to a seperate file and comment out... Or delete the test...

rGPARb3ac7802ffad: ParserTestReader: Support a generalized file-level options clause seems made it new functionality for it to be file wide.

KISS, and as there's only one test... Just merge it into the test itself?

Running parser tests from "/var/www/wiki-1.35/core/extensions/Cite/tests/parser/citeSmokeTests2.txt"...
Running test T240248: Erroring parser function shouldn't break references... PASSED

and with Parser Functions disabled...

Running parser tests from "/var/www/wiki-1.35/core/extensions/Cite/tests/parser/citeSmokeTests2.txt"...
Running test T240248: Erroring parser function shouldn't break references... FAILED!
/var/www/wiki-1.35/core/extensions/Cite/tests/parser/citeSmokeTests2.txt:3
--- /tmp/mwParser-expectedVG67kD	2023-06-25 16:24:41.901029884 +0100
+++ /tmp/mwParser-actualb36w0d	2023-06-25 16:24:41.901029884 +0100
@@ -1,5 +1,5 @@
 <p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup>
-false or error
+{{#ifeq: {{#expr: string &lt; 5 }} | 1 | true | false or error }}
 </p>
 <div class="mw-references-wrap"><ol class="references">
 <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">something</span>

Looking again at rGPARb3ac7802ffad: ParserTestReader: Support a generalized file-level options clause... It does sound, but isn't completely clear if this "extension dependancy" definition is new as of this patch, and as such, this is basically not going to work in REL1_35 without various supporting changes?

Change 932638 merged by jenkins-bot:

[mediawiki/extensions/Cite@REL1_35] parser tests: move test which requires {{#ifeq}} into its own file

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