Page MenuHomePhabricator

Wikibase lib with datavalues/geo 4.2.0 has a test failure
Closed, ResolvedPublic

Description

The current failure is now:

15:41:57 There was 1 error:
15:41:57 
15:41:57 1) Wikibase\Lib\Tests\Formatters\GlobeCoordinateDetailsFormatterTest::testEscaping
15:41:57 TypeError: Return value of Mock_GlobeCoordinateValue_2ce92031::getPrecision() must be of the type float or null, string returned
15:41:57 
15:41:57 /workspace/src/vendor/data-values/geo/src/Formatters/GlobeCoordinateFormatter.php:50
15:41:57 /workspace/src/extensions/Wikibase/lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php:70
15:41:57 /workspace/src/extensions/Wikibase/lib/tests/phpunit/Formatters/GlobeCoordinateDetailsFormatterTest.php:93
15:41:57 /workspace/src/maintenance/doMaintenance.php:99
15:41:57

Seen on https://gerrit.wikimedia.org/r/#/c/mediawiki/vendor/+/550666/ Update datavalues/geo from 3.0.1 to 4.2.0

Blocking T215853

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptNov 22 2019, 3:05 PM

Change 552632 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Do not escape GlobeCoordinateDetailsFormatter value

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

Change 552632 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Do not escape GlobeCoordinateDetailsFormatter value

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

Ladsgroup subscribed.

Now there's another error:

There was 1 failure:
09:27:33 
09:27:33 1) Wikibase\Repo\Tests\Api\ParseValueTest::testParse with data set "good and bad" (array('XYZ|5.5S,37W', 'globe-coordinate'), array('ValueParsers\ParseException', 'globecoordinate'))
09:27:33 === Logs generated by test case
09:27:33 [Wikibase] [debug] {method}: setting {settingName} was given as a closure, resolve it to {logValue} {"method":"Wikibase\\SettingsArray::getSetting","settingName":"conceptBaseUri","logValue":"'http:\/\/127.0.0.1:9412\/entity\/'"}
09:27:33 [wfDebug] [debug] ApiMain::setCacheMode: downgrading cache mode 'public' to 'anon-public-user-private' due to uselang=user {"private":false}
09:27:33 [wfDebug] [debug] ApiMain::setCacheMode: setting cache mode anon-public-user-private {"private":false}
09:27:33 [GlobalTitleFail] [info] MessageCache::parse called by Wikibase\Repo\Api\ApiErrorReporter->addMessageToResult/Wikibase\Repo\Api\ApiErrorReporter->convertMessageToResult/Message->parse/Message->toString/Message->parseText/MessageCache->parse with no title set. {"private":false}
09:27:33 [GlobalTitleFail] [info] MessageCache::parse called by Wikibase\Repo\Api\ApiErrorReporter->addMessageToResult/Wikibase\Repo\Api\ApiErrorReporter->convertMessageToResult/Message->parse/Message->toString/Message->parseText/MessageCache->parse with no title set. {"private":false}
09:27:33 ===
09:27:33 /1/type
09:27:33 Failed asserting that an array has the key 'type'.
09:27:33 
09:27:33 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Api/ParseValueTest.php:251
09:27:33 /workspace/src/extensions/Wikibase/repo/tests/phpunit/includes/Api/ParseValueTest.php:274
09:27:33 /workspace/src/maintenance/doMaintenance.php:99
09:27:33 
09:27:33 FAILURES!
09:27:33 Tests: 17295, Assertions: 158847, Failures: 1, Skipped: 70.

The failure gets fixed if you just swap the values and put the good one first and the bad one second.
Looking at the exception for the second one that makes it return "malformed input" while it's not malformed is this:

Cannot rewind a generator that was already run

I'm honestly lost how this can happen. My knowledge of generators in php is not great either but we are not doing anything with generators as far as I can see.

Looks like the PR was closed and the test failure has been fixed another way

We had two failures, one was the generator, the one was the first one on the ticket, I fixed it but I had to revert it, I think we can revert the revert: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/559450

Honestly it's slight scary :(

Going to claim this as @Ladsgroup is already on vacation.

We shouldn't actually just merge https://gerrit.wikimedia.org/r/#/c/552632 as the Wikibase composer.json doesn't even specify using 4.2.1 yet, and it should

Change 560407 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikibaseQualityConstraints@master] Also allow install with "data-values/geo": ^4.2.1

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

Updated the Wikibase patch to include the new version in composer.json.
Also made the needed patch for QualityConstraints
And updated the vendor patch with the depend-on for both of these..

Change 560407 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Also allow install with "data-values/geo": ^4.2.1

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

Addshore claimed this task.