Page MenuHomePhabricator

ApiBaseTest::testGetParameterFromSettings fails to assert 1000 is identical to 1 (PHP 7.1+)
Closed, ResolvedPublic

Description

Current master seems to fail PHP 7.1 on Travis at https://travis-ci.org/wikimedia/mediawiki/jobs/367942995

1) ApiBaseTest::testGetParameterFromSettings with data set ""1e3" as integer" ('1e3', array('integer'), 1, array())
Failed asserting that 1000 is identical to 1.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/api/ApiBaseTest.php:280
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:421
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94

Also with PHP 7.2 at https://travis-ci.org/wikimedia/mediawiki/jobs/367942994

--
There were 7 failures:
1) ApiBaseTest::testGetParameterFromSettings with data set ""1e3" as integer" ('1e3', array('integer'), 1, array())
Failed asserting that 1000 is identical to 1.
/home/travis/build/wikimedia/mediawiki/tests/phpunit/includes/api/ApiBaseTest.php:280
/home/travis/build/wikimedia/mediawiki/tests/phpunit/MediaWikiTestCase.php:421
/home/travis/build/wikimedia/mediawiki/maintenance/doMaintenance.php:94

This is a regression since last week. Git log identifies d3da5e08d35f67 as a probable cause.

Event Timeline

Krinkle renamed this task from ApiBaseTest::testGetParameterFromSettings fails to assert 1000 is identical to 1 (PHP 7.1) to ApiBaseTest::testGetParameterFromSettings fails to assert 1000 is identical to 1 (PHP 7.1+).Apr 18 2018, 2:22 AM
Krinkle added a project: PHP 7.2 support.
Krinkle updated the task description. (Show Details)

Probably the easiest fix is to just remove the test. Or we could make the validation more strict by rejecting values that don't match /^[+-]?\d+$/ or the like, and adjusting the test to match.

Krinkle triaged this task as High priority.Apr 18 2018, 7:32 PM
Krinkle moved this task from Backlog to MediaWiki core on the PHP 7.1 support board.
Krinkle moved this task from Untriaged to MediaWiki core on the PHP 7.2 support board.

Change 427562 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] API: Remove 1e3>1 test case from ApiBaseTest

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

Change 427562 merged by jenkins-bot:
[mediawiki/core@master] API: Remove 1e3>1 test case from ApiBaseTest

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

Change 427577 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@REL1_31] API: Remove 1e3>1 test case from ApiBaseTest

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

Krinkle claimed this task.

The latest PHP 7.1 build at Travis no longer shows this error. Only remaining failure on PHP 7.1 is T182366.

Change 427577 merged by jenkins-bot:
[mediawiki/core@REL1_31] API: Remove 1e3>1 test case from ApiBaseTest

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