Skip to content

Fix PHPUnit invocation for MW master compatibility#89

Merged
malberts merged 2 commits into
masterfrom
fix-mw-master-ci-runner
May 11, 2026
Merged

Fix PHPUnit invocation for MW master compatibility#89
malberts merged 2 commits into
masterfrom
fix-mw-master-ci-runner

Conversation

@malberts
Copy link
Copy Markdown
Contributor

@malberts malberts commented May 11, 2026

Summary

  • MW master removed tests/phpunit/phpunit.php along with suite.xml and its dedicated bootstrap (T395470, Gerrit I03f0b4ec, MW 1.46-wmf.14). Consumers must now use composer phpunit / vendor/bin/phpunit. This caused the MW master jobs to fail with Could not open input file: tests/phpunit/phpunit.php.
  • Branch on the matrix entry: REL1_43 → REL1_45 keep the existing php tests/phpunit/phpunit.php -c extensions/Bootstrap/ invocation; master generates phpunit.xml from the upstream template and runs vendor/bin/phpunit --group extension-bootstrap.
  • The --group filter (vs. -c extensions/Bootstrap/) is required on master because -c overrides the generated config, including its bootstrap="tests/phpunit/bootstrap.php" attribute. Without that bootstrap, MW globals like $wgResourceModules are never defined and BootstrapManagerTest errors out.
  • Mirrors the pattern applied to ProfessionalWiki/chameleon#482.

Test plan

  • CI passes on REL1_43, REL1_44, REL1_45, master/PHP 8.4, master/PHP 8.5 (14 tests, 19 assertions on master)

🤖 Generated with Claude Code

malberts and others added 2 commits May 11, 2026 19:13
MediaWiki master removed tests/phpunit/phpunit.php in January 2026
(commit 80e3b20a). Branch on the matrix entry so the existing
invocation continues to work for REL1_43 through REL1_45, while
master uses the generated-config + vendor/bin/phpunit flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous -c extensions/Bootstrap/ flag made PHPUnit load Bootstrap's
phpunit.xml.dist, which has no bootstrap directive, so MediaWiki was
never initialised and $GLOBALS['wgResourceModules'] was undefined when
BootstrapManagerTest read it.

Drop -c so MW's generated phpunit.xml (which wires up
tests/phpunit/bootstrap.php) is used, and filter to Bootstrap tests via
their @group annotation. Mirrors the Chameleon CI pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@malberts malberts marked this pull request as ready for review May 11, 2026 18:49
@malberts malberts merged commit 41deebc into master May 11, 2026
5 checks passed
@malberts malberts deleted the fix-mw-master-ci-runner branch May 11, 2026 18:49
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