From b1010541f46f6f0ba8ca24385bfc9ad21b798894 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 1 Jul 2026 10:13:04 +0200 Subject: [PATCH 1/2] Support the MediaWiki 1.46 PHPUnit test runner MediaWiki 1.46 removes tests/phpunit/phpunit.php, so the CI PHPUnit steps failed on the master matrix row with "Could not open input file: tests/phpunit/phpunit.php". Gate both PHPUnit steps on the presence of that entrypoint: keep the existing invocation where it exists, and on newer MediaWiki generate the runner config from the core template (composer phpunit:config) and invoke vendor/bin/phpunit directly. Add a REL1_46 matrix row so the new path is exercised on a stable branch as well. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 315c590..f9db635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,9 @@ jobs: - mw: 'REL1_45' php: '8.4' experimental: false + - mw: 'REL1_46' + php: '8.4' + experimental: true - mw: 'master' php: '8.5' experimental: true @@ -80,10 +83,30 @@ jobs: run: php maintenance/update.php --quick - name: Run PHPUnit - run: php tests/phpunit/phpunit.php -c extensions/SimpleBatchUpload/ + run: | + if [ -f tests/phpunit/phpunit.php ]; then + php tests/phpunit/phpunit.php -c extensions/SimpleBatchUpload/ + else + # MW 1.46 and later + 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 + MEDIAWIKI_HAS_INTEGRATION_TESTS=1 vendor/bin/phpunit -c phpunit.xml extensions/SimpleBatchUpload/tests/phpunit + fi - name: Run PHPUnit with code coverage - run: php tests/phpunit/phpunit.php -c extensions/SimpleBatchUpload/ --coverage-clover coverage.xml + run: | + if [ -f tests/phpunit/phpunit.php ]; then + php tests/phpunit/phpunit.php -c extensions/SimpleBatchUpload/ --coverage-clover coverage.xml + else + # MW 1.46 and later + 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 + MEDIAWIKI_HAS_INTEGRATION_TESTS=1 vendor/bin/phpunit -c phpunit.xml extensions/SimpleBatchUpload/tests/phpunit --coverage-clover coverage.xml + fi - name: Upload code coverage run: bash <(curl -s https://codecov.io/bash) From bcbbed5e60e6de309ead3efce3aa944d2a6a83bd Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 1 Jul 2026 10:25:35 +0200 Subject: [PATCH 2/2] Drop the dead code coverage steps The coverage step re-ran the whole suite on every job, and the upload used the codecov bash uploader that was sunset in 2022, so it collected and uploaded nothing. No other extension in the stack gathers coverage. Run the suite once per job. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9db635..2e93354 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,20 +94,3 @@ jobs: composer phpunit:config MEDIAWIKI_HAS_INTEGRATION_TESTS=1 vendor/bin/phpunit -c phpunit.xml extensions/SimpleBatchUpload/tests/phpunit fi - - - name: Run PHPUnit with code coverage - run: | - if [ -f tests/phpunit/phpunit.php ]; then - php tests/phpunit/phpunit.php -c extensions/SimpleBatchUpload/ --coverage-clover coverage.xml - else - # MW 1.46 and later - 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 - MEDIAWIKI_HAS_INTEGRATION_TESTS=1 vendor/bin/phpunit -c phpunit.xml extensions/SimpleBatchUpload/tests/phpunit --coverage-clover coverage.xml - fi - - - name: Upload code coverage - run: bash <(curl -s https://codecov.io/bash) - if: github.ref == 'refs/heads/master'