From 92d010095faadf69c639a4724f504ae944df5a0e Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Mon, 11 May 2026 19:13:45 +0200 Subject: [PATCH 1/2] Fix PHPUnit invocation for MW master compatibility 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) --- .github/workflows/ci.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8787aed..5e54e70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,5 +80,21 @@ jobs: - name: Composer update run: composer update - - name: Run PHPUnit + # "master" currently tracks MW >= 1.46, where tests/phpunit/phpunit.php + # was removed. Once REL1_46 lands in the matrix, it needs the master + # invocation below as well. + - name: Run PHPUnit (MW < master) + if: matrix.mw != 'master' run: php tests/phpunit/phpunit.php -c extensions/Bootstrap/ + + - name: Run PHPUnit (MW master) + if: matrix.mw == 'master' + run: | + # TODO: phpunit.xml.template is export-ignored from GitHub's tarball + # archive, so we fetch it separately. Remove this once installWiki.sh + # switches to `git clone`, or MW drops the export-ignore. + if [ ! -f phpunit.xml.template ]; then + wget -q -O phpunit.xml.template "https://raw.githubusercontent.com/wikimedia/mediawiki/${{ matrix.mw }}/phpunit.xml.template" + fi + composer phpunit:config + vendor/bin/phpunit -c extensions/Bootstrap/ From a87037b248ce487e0ac89e86d4128d377abf7550 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Mon, 11 May 2026 20:42:29 +0200 Subject: [PATCH 2/2] Use --group filter for MW master phpunit run 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) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e54e70..f4e7ac3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,4 +97,4 @@ jobs: wget -q -O phpunit.xml.template "https://raw.githubusercontent.com/wikimedia/mediawiki/${{ matrix.mw }}/phpunit.xml.template" fi composer phpunit:config - vendor/bin/phpunit -c extensions/Bootstrap/ + vendor/bin/phpunit --group extension-bootstrap