Page MenuHomePhabricator

Test output changes slightly between PHP versions
Closed, ResolvedPublic

Description

See https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/635576 and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/635815/4

Seems to be subtle whitespace changes, but enough to cause the tests to fail which is annoying and slightly concerning.

Event Timeline

This only affects the tests for CommentFormatter, which uses HtmlFormatter, which uses he built-in DOM methods in PHP. The tests for code using Parsoid only don't have this problem.

The following all fail for me locally:

php7.2 ../../core/tests/phpunit/phpunit.php tests/phpunit/CommentFormatterTest.php
php7.3 ../../core/tests/phpunit/phpunit.php tests/phpunit/CommentFormatterTest.php
php7.4 ../../core/tests/phpunit/phpunit.php tests/phpunit/CommentFormatterTest.php

using these versions:

PHP 7.2.34-8+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:57:33) ( NTS )
PHP 7.3.24-3+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 17:00:17) ( NTS )
PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:25) ( NTS )

Maybe there is some common system dependency, or config, rather than PHP version?

Change 641197 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Use Parsoid DOMCompat/DOMUtils in CommentFormatter

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

Change 641197 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Use Parsoid DOMCompat/DOMUtils in CommentFormatter

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

ppelberg claimed this task.