[go: nahoru, domu]

Page MenuHomePhabricator

[ES-M2]: EntitySchema phpunit tests should also run in client only mode in CI
Open, Needs TriagePublic

Description

After T363153 we should run the ES phpunit tests in CI in a client only configuration on top of running them with repo (as we currently do).

This already exists for Wikibase, thus we can probably adopt the configuration from there. See Wikibase configurations at:

https://gerrit.wikimedia.org/r/plugins/gitiles/integration/config/+/refs/heads/master/zuul/layout.yaml#5300
https://gerrit.wikimedia.org/r/plugins/gitiles/integration/config/+/refs/heads/master/jjb/mediawiki.yaml#1075
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/master/build/jenkins/mw-apply-wb-settings.sh

AC:

  • In CI the EntitySchema phpunit test suite is run in a configuration where WikibaseRepo is not present (or at least $wgEntitySchemaIsRepo is false)

Event Timeline

Prio Notes:

Impact AreaAffected
production / end usersno
monitoringno
development effortsyes
onboarding effortsno
additional stakeholdersno

Story Writing Notes

  • Find example of current client only test configs
  • Add ACs

Change #1052284 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/EntitySchema@master] Add jenkins client-only test environment configuration script

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

Change #1052288 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[integration/config@master] Add client-only jobs for EntitySchema

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

Change #1052669 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[integration/config@master] Add Wikibase client-only jobs to EntitySchema checks

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

Change #1052673 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] Add setup for EntitySchema to Wikibase CI setup

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

Change #1052676 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/EntitySchema@master] Tag EntitySchema client integration tests with EntitySchemaClient

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

Change #1052288 abandoned by Arthur taylor:

[integration/config@master] Add client-only jobs for EntitySchema

Reason:

Superceded by I93a08d9e8c88aacd2ec4dce8a052343fbf365a13

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

Mentioned in SAL (#wikimedia-releng) [2024-07-11T12:35:49Z] <hashar> Updating wikibase-client job to have it integrated with EntitySchema | https://gerrit.wikimedia.org/r/1052669 - T367156

Change #1052669 merged by jenkins-bot:

[integration/config@master] Add Wikibase client-only jobs to EntitySchema checks

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

Change #1053683 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] Revert "Add Wikibase client-only jobs to EntitySchema checks"

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

Change #1053683 merged by jenkins-bot:

[integration/config@master] Revert "Add Wikibase client-only jobs to EntitySchema checks"

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

I have deployed the change which adds EntitySchema as a dependency of the wikibase-client Jenkins job. Unfortunately that caused a patch made to Wikibase to fail ( https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1053679/1 ).

The console log was https://integration.wikimedia.org/ci/job/wikibase-client-php81/818/consoleFull . That is the EntitySchema tests failing because they depend on WikibaseRepo: Error: Class "Wikibase\Repo\WikibaseRepo" not found. Example:

1) Wikibase\Client\Tests\Integration\Hooks\EchoNotificationsHandlersTest::testWikibaseHandleChange
Error: Class "Wikibase\Repo\WikibaseRepo" not found

/workspace/src/extensions/EntitySchema/src/EntitySchema.ServiceWiring.php:95
/workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:447
/workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:411
/workspace/src/includes/MediaWikiServices.php:354
/workspace/src/vendor/wikimedia/services/src/ServiceContainer.php:419
/workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory.php:211
/workspace/src/vendor/wikimedia/object-factory/src/ObjectFactory.php:149
/workspace/src/includes/HookContainer/HookContainer.php:256
/workspace/src/includes/HookContainer/HookContainer.php:348
/workspace/src/includes/HookContainer/HookContainer.php:524
/workspace/src/includes/HookContainer/HookContainer.php:146
/workspace/src/includes/HookContainer/HookRunner.php:2065
/workspace/src/includes/linker/LinkRenderer.php:489
/workspace/src/includes/linker/LinkRenderer.php:250
/workspace/src/includes/linker/LinkRenderer.php:296
/workspace/src/includes/linker/LinkRenderer.php:186
/workspace/src/includes/linker/LinkRenderer.php:457
/workspace/src/includes/content/WikitextContentHandler.php:406
/workspace/src/includes/content/ContentHandler.php:1673
/workspace/src/includes/content/Renderer/ContentRenderer.php:67
/workspace/src/includes/Revision/RenderedRevision.php:260
/workspace/src/includes/Revision/RenderedRevision.php:232
/workspace/src/includes/Revision/RevisionRenderer.php:226
/workspace/src/includes/Revision/RevisionRenderer.php:164
/workspace/src/includes/Revision/RenderedRevision.php:199
/workspace/src/includes/Storage/DerivedPageDataUpdater.php:1457
/workspace/src/includes/Storage/DerivedPageDataUpdater.php:1855
/workspace/src/includes/Storage/DerivedPageDataUpdater.php:1745
/workspace/src/includes/Storage/DerivedPageDataUpdater.php:1590
/workspace/src/includes/Storage/PageUpdater.php:1630
/workspace/src/includes/libs/rdbms/database/Database.php:2265
/workspace/src/includes/libs/rdbms/database/DBConnRef.php:127
/workspace/src/includes/libs/rdbms/database/DBConnRef.php:654
/workspace/src/includes/deferred/AtomicSectionUpdate.php:41
/workspace/src/includes/deferred/DeferredUpdates.php:486
/workspace/src/includes/deferred/DeferredUpdates.php:198
/workspace/src/includes/deferred/DeferredUpdates.php:285
/workspace/src/includes/deferred/DeferredUpdatesScope.php:269
/workspace/src/includes/deferred/DeferredUpdatesScope.php:198
/workspace/src/includes/deferred/DeferredUpdates.php:304
/workspace/src/includes/deferred/DeferredUpdates.php:368
/workspace/src/includes/deferred/DeferredUpdates.php:162
/workspace/src/includes/Storage/PageUpdater.php:1579
/workspace/src/includes/Storage/PageUpdater.php:935
/workspace/src/includes/page/WikiPage.php:1692
/workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:1651
/workspace/src/extensions/Wikibase/client/tests/phpunit/integration/includes/Hooks/EchoNotificationsHandlersTest.php:166

Tentatively due to some hook calling EntitySchema.LabelLookup which does depends on WikibaseRepo:

'EntitySchema.LabelLookup' => static function ( MediaWikiServices $services ): ?LabelLookup {
    if ( !$services->getMainConfig()->get( 'EntitySchemaIsRepo' ) ) {
        return null;
    }
    return new LabelLookup(
        EntitySchemaServices::getFullViewSchemaDataLookup( $services ),
        WikibaseRepo::getLanguageFallbackChainFactory( $services )
    );
},

Per my comment on the patch, I think this change needs to depend on I73f465d86eafc377ad69c5054404673108c3f182. $wgEntitySchemaIsRepo = false; needs to be set in the CI setup, otherwise these service wiring errors will show.

Change #1052673 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add setup for EntitySchema to Wikibase CI setup

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

That config patch has been merged now. @hashar could you give the original patch another shot at some point? Thanks!

Change #1052676 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Tag EntitySchema client integration tests with EntitySchemaClient

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

Change #1052284 abandoned by Arthur taylor:

[mediawiki/extensions/EntitySchema@master] Add jenkins client-only test environment configuration script

Reason:

Is taken care of by Iea6c031d610a37c17474cf06dcb276b46ad71086

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

Thanks for the nudge. I've created the re-revert now - would need @hashar to take a look and approve that. I've abandoned the other change.

Change #1062682 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[integration/config@master] Revert^2 "Add Wikibase client-only jobs to EntitySchema checks"

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