Page MenuHomePhabricator

Docker-dev: investigate and document how to run Parsoid parser tests in Cite
Closed, ResolvedPublic

Description

TechWish's docker-dev README currently includes instructions on how to run parser tests from the host environment. However, this doesn't seem to include the Parsoid variations of the test cases.

For example (legacy parser only):

./modules/mediawiki/bin/mwscript tests/parser/parserTests.php --wiki=dev --file=/srv/docker-dev/mediawiki/extensions/Cite/tests/parser/citeParserTests.txt

Looking in citeParserTests.txt, you will see blocks labeled with !! html/parsoid. To demonstrate that these tests aren't being executed, try modifying the expected output. This should cause a test to fail but does not.

In theory, it should be as simple as adding the --parsoid flag to the parserTests.php commandline, but this results in a huge number of warnings like

Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in /X/mediawiki-core/tests/parser/ParserTestRunner.php on line 1150

This also causes a large multiplication of the tests—maybe the commandline can be streamlined.

During testing it would also be convenient to document how to run a single test case against Parsoid, for example --filter "<ref> with a simple template"

Code to review

Event Timeline

There was a conclusion to this task, but it still needs to be written about in the README. Run parsoid tests like this,

./modules/mediawiki/bin/mwscript tests/parser/parserTests.php --wiki=dev --file=/srv/docker-dev/mediawiki/extensions/Cite/tests/parser/citeParserTests.txt --filter 'Non-diffing' --parsoid

There are lots of options to parserTests.php, see --help for the full listing.

awight updated the task description. (Show Details)
awight moved this task from Doing to Tech Review on the WMDE-TechWish-Holiday-Sprint-2024-12-13 board.