From b5acb59cc67e26a276c0c92d71ffcae8dba5b4a2 Mon Sep 17 00:00:00 2001 From: malberts Date: Thu, 21 May 2026 11:38:46 +0200 Subject: [PATCH] =?UTF-8?q?[TEST=20=E2=80=94=20DO=20NOT=20MERGE]=20try=20u?= =?UTF-8?q?nified=20phpunit=20runner=20with=20--group=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/ci.yml | 20 +++++++++++++++----- .github/workflows/installWiki.sh | 7 +++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df5ea06..088773e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }} (TYPE ${{ matrix.type }})" strategy: + fail-fast: false # [TEST BRANCH] show every entry's verdict, don't matrix-mate cancel matrix: include: - mw: 'REL1_39' @@ -74,7 +75,7 @@ jobs: mediawiki !mediawiki/extensions/ !mediawiki/vendor/ - key: mw_${{ matrix.mw }}-php${{ matrix.php }} + key: mw_${{ matrix.mw }}-php${{ matrix.php }}-experiment - name: Cache Composer cache uses: actions/cache@v4 @@ -103,12 +104,21 @@ jobs: run: bash EarlyCopy/.github/workflows/uploadImages.sh - if: env.TYPE != 'coverage' - name: Run PHPUnit w/o coverage - run: php tests/phpunit/phpunit.php -c extensions/BootstrapComponents/ --testsuite bootstrap-components-unit + name: '[TEST] Run PHPUnit (unified runner, --group mediawiki-databaseless)' + run: | + (composer phpunit:config 2>/dev/null || true) + vendor/bin/phpunit -c extensions/BootstrapComponents/phpunit.xml.dist \ + --bootstrap tests/phpunit/bootstrap.php \ + --group mediawiki-databaseless - if: env.TYPE == 'coverage' - name: Run PHPUnit w/ coverage - run: php tests/phpunit/phpunit.php -c extensions/BootstrapComponents/ --testsuite bootstrap-components-unit --coverage-clover coverage.clover + name: '[TEST] Run PHPUnit (unified runner, --group mediawiki-databaseless, coverage)' + run: | + (composer phpunit:config 2>/dev/null || true) + vendor/bin/phpunit -c extensions/BootstrapComponents/phpunit.xml.dist \ + --bootstrap tests/phpunit/bootstrap.php \ + --group mediawiki-databaseless \ + --coverage-clover coverage.clover - if: env.TYPE == 'coverage' name: upload coverage report diff --git a/.github/workflows/installWiki.sh b/.github/workflows/installWiki.sh index 62b6662..0aacc9d 100644 --- a/.github/workflows/installWiki.sh +++ b/.github/workflows/installWiki.sh @@ -4,10 +4,9 @@ MW_BRANCH=$1 EXTENSION_NAME=$2 ## install core -wget https://github.com/wikimedia/mediawiki/archive/${MW_BRANCH}.tar.gz -nv - -tar -zxf $MW_BRANCH.tar.gz -mv mediawiki-$MW_BRANCH mediawiki +# [TEST BRANCH] git clone instead of tarball — MW master needs +# phpunit.xml.template which is export-ignored from the archive. +git clone --depth 1 --branch "$MW_BRANCH" https://github.com/wikimedia/mediawiki.git mediawiki cd $MW_ROOT composer install