Page MenuHomePhabricator

Graph behaves differently on PHP7
Closed, ResolvedPublic

Description

Can't say it's a bad breakage, however something's different:

vagrant@mediawiki-vagrant:/vagrant/mediawiki$ mwscript tests/parser/parserTests.php --wiki=wiki --file=extensions/Graph/tests/parserTests.txt
This is MediaWiki version 1.28.0-alpha.

Running parser tests from "extensions/Graph/tests/parserTests.txt"...
Running test <graph>... PASSED
Running test <graph> - error handling... PASSED

Passed 2 of 2 tests (100%)... ALL TESTS PASSED!
vagrant@mediawiki-vagrant:/vagrant/mediawiki$ PHP=php7.0 mwscript tests/parser/parserTests.php --wiki=wiki --file=extensions/Graph/tests/parserTests.txt
This is MediaWiki version 1.28.0-alpha.

Running parser tests from "extensions/Graph/tests/parserTests.txt"...
Running test <graph>... PASSED
Running test <graph> - error handling... FAILED!
--- /tmp/mwParser-1722784253-expected	2016-10-14 21:37:07.095632647 +0000
+++ /tmp/mwParser-1722784253-actual	2016-10-14 21:37:07.099632647 +0000
@@ -1,6 +1,6 @@
-<div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>
-<div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>
 <p><span class="error">Syntax error</span>
+<span class="error">Syntax error</span>
+<span class="error">Syntax error</span>
 </p>
 <div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>


Passed 1 of 2 tests (50%)... 1 tests failed!

Event Timeline

That's weird - does it mean it only detects the error in php7, but not in hhvm?? Could this be due to the different JSON rules, e.g. HHVM handling trailing commas properly?

MaxSem claimed this task.

This was fixed with reinforced checks in https://gerrit.wikimedia.org/r/#/c/316024/ however I'm unsure what exactly was wrong.