Page MenuHomePhabricator

Failing ParserIntegrationTest PHPUnit test causes CI failures for various extensions
Closed, ResolvedPublic

Description

FlaggedRevs

Scribunto

RelatedArticles

WikibaseLexeme

Example

No idea how to/where to fix this.

13:02:06 Time: 2.54 minutes, Memory: 152.28MB
13:02:06 
13:02:06 There was 1 failure:
13:02:06 
13:02:06 1) ParserIntegrationTest::testParse with data set "parserTests.txt: XSS is escaped (inline)" ('[details omitted]')
13:02:06 Failed asserting that two strings are equal.
13:02:06 --- Expected
13:02:06 +++ Actual
13:02:06 @@ @@
13:02:06 -'<p><code class="mw-highlight" dir="ltr">&lt;script&gt;alert("pwnd")&lt;/script&gt; &lt;IMG SRC=`javascript:alert("RSnake says, 'XSS'")`&gt; &lt;IMG SRC=&amp;#106;&amp;#97;&amp;#118;&amp;#97;&amp;#115;&amp;#99;&amp;#114;&amp;#105;&amp;#112;&amp;#116;&amp;#58;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40; &amp;#39;&amp;#88;&amp;#83;&amp;#83;&amp;#39;&amp;#41; \";alert('XSS');// &lt;/script&gt;&lt;script&gt;alert('XSS');&lt;/script&gt;&#160;%253cscript%253ealert(document.cookie)%253c/script%253e</code>
13:02:06 +'<p><code class="mw-highlight" dir="ltr">&lt;script&gt;alert("pwnd")&lt;/script&gt; &lt;IMG SRC=`javascript:alert("RSnake says, 'XSS'")`&gt; &lt;IMG SRC=&amp;#106;&amp;#97;&amp;#118;&amp;#97;&amp;#115;&amp;#99;&amp;#114;&amp;#105;&amp;#112;&amp;#116;&amp;#58;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40; &amp;#39;&amp;#88;&amp;#83;&amp;#83;&amp;#39;&amp;#41; \";alert('XSS');// &lt;/script&gt;&lt;script&gt;alert('XSS');&lt;/script&gt; %253cscript%253ealert(document.cookie)%253c/script%253e</code>
13:02:06  </p>'
13:02:06 
13:02:06 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:53
13:02:06 /workspace/src/maintenance/doMaintenance.php:94
13:02:06 
13:02:06 FAILURES!
13:02:06 Tests: 4484, Assertions: 27866, Failures: 1, Skipped: 14.
13:02:07 Traceback (most recent call last):
13:02:07   File "/usr/local/bin/quibble", line 9, in <module>
13:02:07     load_entry_point('quibble==0.0.0', 'console_scripts', 'quibble')()
13:02:07   File "/usr/local/lib/python3.4/dist-packages/quibble/cmd.py", line 462, in main
13:02:07     cmd.execute()
13:02:07   File "/usr/local/lib/python3.4/dist-packages/quibble/cmd.py", line 404, in execute
13:02:07     testsuite=testsuite)
13:02:07   File "/usr/local/lib/python3.4/dist-packages/quibble/test.py", line 121, in run_phpunit
13:02:07     subprocess.check_call(cmd, cwd=mwdir, env=phpunit_env)
13:02:07   File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
13:02:07     raise CalledProcessError(retcode, cmd)
13:02:07 subprocess.CalledProcessError: Command '['php', 'tests/phpunit/phpunit.php', '--debug-tests', '--testsuite', 'extensions', '--exclude-group', 'Broken,ParserFuzz,Stub']' returned non-zero exit status 1
13:02:07 INFO:backend.MySQL:Terminating MySQL
13:02:10 Build step 'Execute shell' marked build as failure
13:02:11 Archiving artifacts
13:02:11 [PostBuildScript] - Execution post build scripts.
13:02:11 [PostBuildScript] Build is not success : do not execute script
13:02:11 [PostBuildScript] - Execution post build scripts.
13:02:11 [quibble-vendor-mysql-hhvm-docker] $ /bin/bash -xe /tmp/jenkins8246004493847339065.sh
13:02:11 + echo 'Clearing /srv/jenkins-workspace/workspace/quibble-vendor-mysql-hhvm-docker/cache'
13:02:11 Clearing /srv/jenkins-workspace/workspace/quibble-vendor-mysql-hhvm-docker/cache
13:02:11 ++ pwd
13:02:11 + exec docker run --rm --env-file /dev/fd/63 --volume /srv/jenkins-workspace/workspace/quibble-vendor-mysql-hhvm-docker/cache:/cache docker-registry.wikimedia.org/releng/castor:0.1.3 clear
13:02:11 ++ egrep -v '^(HOME|SHELL|PATH|LOGNAME|MAIL|HHVM_REPO_CENTRAL_PATH)='
13:02:11 ++ /usr/bin/env
13:02:12 Finished: FAILURE

Event Timeline

Hmm, this is the same failure that was seen in a FlaggedRevs patch that people were discussin in #wikimedia-tech a few days ago.

zeljkofilipin renamed this task from PHPUnit tests fail for Scribunto to PHPUnit tests fail for Scribunto and RelatedArticles.Jul 16 2018, 10:47 AM
zeljkofilipin triaged this task as High priority.
zeljkofilipin added a project: RelatedArticles.

Same problem apparently affecting WikibaseLexeme CI as well (change, console).

Lucas_Werkmeister_WMDE renamed this task from PHPUnit tests fail for Scribunto and RelatedArticles to Failing ParserIntegrationTest PHPUnit test causes CI failures for various extensions.Jul 16 2018, 10:52 AM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
Anomie subscribed.

The failure is coming from a test in SyntaxHighlight, caused by rMWbe266087b47c: Don't armor french spaces before punctuation followed by word characters removing a case where a space was getting turned into a non-breaking space.

Specifically, before that change the space in &gt; %253c was being replaced with a non-breaking space, which the addition of (?!\w) to the regex in that change now prevents.

Probably the extension's unit test should be updated for the new behavior.

Change 445989 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/core@master] Fix test database prefix in MediaWikiTestCase

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

Change 445992 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Update parser test for core change

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

Change 445992 merged by jenkins-bot:
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Update parser test for core change

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

Lucas_Werkmeister_WMDE assigned this task to Anomie.

On the WikibaseLexeme change, CI is passing again, so it looks like the fix is working. Thanks @Anomie!