Page MenuHomePhabricator

CachingKartographerEmbeddingHandlerTest phpunit test from Wikibase is failing
Closed, ResolvedPublic

Description

From https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-hhvm-docker/51410/consoleFull

There were 2 failures:

1) Wikibase\Lib\Tests\Formatters\CachingKartographerEmbeddingHandlerTest::testGetMapframeInitJS
=== Logs generated by test case
[wfDebug] [debug] ParserFactory: using preprocessor: Preprocessor_Hash {"private":false}
===
Failed asserting that '<script>if ( !mw.config.exists( 'wgKartographerLiveData' ) ) { mw.config.set( 'wgKartographerLiveData', {} ); }mw.config.get( 'wgKartographerLiveData' )["maps"] = "awesome";mw.loader.using( ["rl-module-1","another-rl-module","ext.kartographer.frame"] ).then( function() { mw.loader.require( 'ext.kartographer.frame' ).initMapframeFromElement( $( "#foo" ).find( '.mw-kartographer-map' ).get( 0 ) ); } );</script>' starts with "<script type="text/javascript">".

/workspace/src/extensions/Wikibase/lib/tests/phpunit/Formatters/CachingKartographerEmbeddingHandlerTest.php:154
/workspace/src/tests/phpunit/MediaWikiTestCase.php:427
/workspace/src/maintenance/doMaintenance.php:99

2) Wikibase\Lib\Tests\Formatters\CachingKartographerEmbeddingHandlerTest::testGetMapframeInitJS_escaping
=== Logs generated by test case
[wfDebug] [debug] ParserFactory: using preprocessor: Preprocessor_Hash {"private":false}
===
Failed asserting that '<script>if ( !mw.config.exists( 'wgKartographerLiveData' ) ) { mw.config.set( 'wgKartographerLiveData', {} ); }mw.config.get( 'wgKartographerLiveData' )["m\"a\"ps"] = "awe\"s\"ome";mw.loader.using( ["rl-\"mo\"dule","ext.kartographer.frame"] ).then( function() { mw.loader.require( 'ext.kartographer.frame' ).initMapframeFromElement( $( "#f\"o\"o" ).find( '.mw-kartographer-map' ).get( 0 ) ); } );</script>' starts with "<script type="text/javascript">".

/workspace/src/extensions/Wikibase/lib/tests/phpunit/Formatters/CachingKartographerEmbeddingHandlerTest.php:174
/workspace/src/tests/phpunit/MediaWikiTestCase.php:427
/workspace/src/maintenance/doMaintenance.php:99

I have added Kartographer as dependency to JsonConfig extension - https://gerrit.wikimedia.org/r/#/c/integration/config/+/513698/
But I have no idea if that is related, JsonConfig and Kartographer cloned on that change

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptMay 31 2019, 10:12 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Umherirrender triaged this task as Unbreak Now! priority.May 31 2019, 10:21 PM
Umherirrender added a subscriber: Jdforrester-WMF.
Restricted Application added subscribers: Liuxinyu970226, Mholloway. · View Herald TranscriptMay 31 2019, 10:21 PM

Change 513707 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] Revert "[JsonConfig] Add dependency"

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

Change 513707 merged by jenkins-bot:
[integration/config@master] Revert "[JsonConfig] Add dependency"

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

Mentioned in SAL (#wikimedia-releng) [2019-05-31T23:34:09Z] <James_F> Reloading Zuul to remove Kartographer dependency for JsonConfig T224785

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to High.Jun 1 2019, 12:53 AM

So, with the revert this is no longer triggering for all repos (good), but it seems to still be doing so for Kartographer itself. Was there a faulty assumption written into some tests in Wikibase?

Downgrading as this is only breaking one repo.

The test contains

		if ( !ExtensionRegistry::getInstance()->isLoaded( 'Kartographer' ) ) {
			$this->markTestSkipped( 'Kartographer not installed' );
		}

So it was never tested before the dependency was added and now is failing on the extension who is tested, because the extension is running with Wikibase

Change 513727 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/extensions/Wikibase@master] Fix CachingKartographerEmbeddingHandlerTest

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

Mentioned in SAL (#wikimedia-releng) [2019-06-01T22:54:38Z] <James_F> Reloading Zuul to re-add Kartographer dependency for JsonConfig T224785

Change 513727 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix CachingKartographerEmbeddingHandlerTest

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