CI: switch to vendor/bin/phpunit for MediaWiki master#77
Draft
malberts wants to merge 1 commit into
Draft
Conversation
7ff9008 to
31def84
Compare
31def84 to
9346482
Compare
MediaWiki master (≥ 1.46) removed the bundled `tests/phpunit/phpunit.php`
runner — the master matrix entry was failing with
"Could not open input file: tests/phpunit/phpunit.php".
For the master matrix entry only, drive PHPUnit via:
composer phpunit:config
vendor/bin/phpunit -c extensions/BootstrapComponents/phpunit.xml.dist \
--bootstrap tests/phpunit/bootstrap.php \
--testsuite bootstrap-components-unit
`composer phpunit:config` (introduced on master) generates the
runner-side phpunit.xml from `phpunit.xml.template`. MW's
`.gitattributes` marks that template as `export-ignore`, so it's
missing from the source-archive tarball that `installWiki.sh` was
fetching with `wget`. Switch `installWiki.sh` to `git clone --depth 1`
so the file ships. Empirically the same wall-clock time (~7-9s either
way over GH-to-GH) and ~40MB extra `.git/` retained in the cached
`mediawiki/` tree.
Bump the `mediawiki/` cache-key suffix to `-v2` so existing caches
populated by the old wget path don't shadow the new git-clone install.
Gate the existing two PHPUnit invocations on `matrix.mw != 'master'`
so REL1_39–REL1_43 keep their working behaviour unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9346482 to
7f6315c
Compare
malberts
pushed a commit
that referenced
this pull request
May 21, 2026
Throwaway experiment to find out whether `--group mediawiki-databaseless` short-circuits PHPUnit's test discovery *before* the suite-time hazards fire — i.e. whether modern PHPUnit skips loading test files whose class-level group annotation doesn't match the filter. Predictions for each matrix entry, given the failure mode each branch showed in earlier iterations: - REL1_39 — under the new runner, Scribunto's Scribunto_LuaEngineTestBase::suite() static method blew up at discovery time on MediaWikiServices::getParserFactory(). If --group filtering short-circuits class load, this entry should now pass. Otherwise same failure as before. - REL1_40, REL1_41, REL1_42 — never reached in the prior big-bang attempt (matrix-mate cancellation). Now we'll see. - REL1_43 — same as above. - master — Scribunto_LuaEngineTestBase class wasn't autoloadable (renamed/namespaced on current Scribunto). Same load-vs-filter question. Only LuaLibrary* tests carry `@group Database`; all other unit tests carry `@group mediawiki-databaseless` and would be the ones actually run. Also pulls in two supporting changes from #77 so master has a chance: * installWiki.sh: git clone instead of wget tarball (phpunit.xml.template ships in git but is export-ignored from the archive) * MediaWiki cache key bumped to a one-off `-experiment` suffix so the experimental install actually runs and doesn't shadow itself onto other PRs' caches Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MediaWiki master (≥ 1.46) removed the bundled
tests/phpunit/phpunit.phprunner. The master matrix entry has been failing with:It's been hidden behind
experimental: true/continue-on-error: true, but it's red on every PR (e.g. #75).What
Drive the master matrix entry through the supported new flow:
Three pieces:
composer phpunit:config(introduced on master) generates the runner-sidephpunit.xmlfromphpunit.xml.templatein the MediaWiki root.vendor/bin/phpunit -c extensions/BootstrapComponents/phpunit.xml.distkeeps using this extension's own testsuite definitions (bootstrap-components-unit).--bootstrap tests/phpunit/bootstrap.phpruns MediaWiki's own bootstrap before discovery soExtensionRegistry(used by BC'stests/bootstrap.php) is available.Supporting changes:
installWiki.sh: switch fromwgettarball togit clone --depth 1. MediaWiki's.gitattributesmarksphpunit.xml.templateasexport-ignore, so GitHub's source-archive tarball doesn't ship it.git clonedoes. Benchmarked locally — wall-clock is the same (~7–9 s either way), and the cachedmediawiki/tree grows by ~40 MB for the retained.git/directory (immaterial on GH runners).mw_${{ matrix.mw }}-php${{ matrix.php }}cache key to-v2so existing caches populated by the old wget path don't shadow the new git-clone install.The existing two invocations on REL1_39–REL1_43 are gated on
matrix.mw != 'master'and otherwise unchanged — so non-master entries' behaviour is preserved.Verifying
This PR's CI run is the test. Expected outcome: REL1_39–REL1_43 entries stay green, master entry reaches the actual PHPUnit phase (test pass/fail on master itself — including any BC-test-code compatibility with the current Scribunto API — is out of scope for this PR; the goal is to unblock the runner).
🤖 Generated with Claude Code