Skip to content

Force the integration-test bootstrap for MediaWiki 1.46+#97

Merged
malberts merged 1 commit into
masterfrom
ci/integration-bootstrap
Jun 12, 2026
Merged

Force the integration-test bootstrap for MediaWiki 1.46+#97
malberts merged 1 commit into
masterfrom
ci/integration-bootstrap

Conversation

@malberts

@malberts malberts commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

What

MediaWiki 1.46 replaced tests/phpunit/phpunit.php with vendor/bin/phpunit, whose
bootstrap treats a /unit test path as unit-only and skips loading MediaWiki settings
and the service container. BootstrapComponents' tests/phpunit/Unit/ tests are not
strictly unit tests (they use MediaWiki services), so under the new runner they error
with Premature access to service container.

Forcing the integration-test bootstrap via MEDIAWIKI_HAS_INTEGRATION_TESTS=1 lets them
run. The pre-1.46 rows are unaffected; the 1.46/master rows stay experimental.

Temporary

This is a workaround. The proper fix, reclassifying the service-using tests as
integration tests so the override is no longer needed, is tracked in #98.

@malberts malberts force-pushed the ci/integration-bootstrap branch 2 times, most recently from 8230e8b to 26a3315 Compare June 12, 2026 08:24
MediaWiki 1.46 replaced tests/phpunit/phpunit.php with vendor/bin/phpunit,
whose bootstrap decides between unit and integration mode from the test path:
a path under "/unit" is treated as unit-only, and in that mode MediaWiki
settings and the service container are not loaded. The tests under
tests/phpunit/Unit are not strictly unit tests, they construct objects that
use MediaWiki services, so under the new runner they all error with
"Premature access to service container".

Force the integration-test bootstrap with MEDIAWIKI_HAS_INTEGRATION_TESTS so
those tests run. This is a temporary workaround; the proper fix is to
reclassify the service-using tests as integration tests
(MediaWikiIntegrationTestCase, outside the unit path), after which MediaWiki
selects the right bootstrap on its own.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@malberts malberts force-pushed the ci/integration-bootstrap branch from 26a3315 to 94dbdb2 Compare June 12, 2026 08:28
@malberts malberts marked this pull request as ready for review June 12, 2026 08:30
@malberts malberts merged commit 345595a into master Jun 12, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant