Skip to content

Commit 479ae87

Browse files
committed
Tests: Address review feedback on PHPUnit 10 configuration and workflow integration
- Remove --verbose and -v options from reusable-phpunit-tests-v3.yml since PHPUnit 10 rejects them. - Pass -c "${PHPUNIT_CONFIG}" to the Xdebug test step in reusable-phpunit-tests-v3.yml. - Restore JUnit logging in tests/phpunit/multisite10.xml matching tests/phpunit/multisite.xml. See #66210, #62004.
1 parent 778c4ee commit 479ae87

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎.github/workflows/reusable-phpunit-tests-v3.yml‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,14 @@ jobs:
335335
- name: Run external HTTP tests
336336
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
337337
continue-on-error: ${{ inputs.allow-errors }}
338-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http
338+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group external-http
339339

340340
# PHPUnit versions used below PHP 7.3 do not support --fail-on-empty-test-suite.
341341
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }}
342342
continue-on-error: ${{ inputs.allow-errors }}
343343
run: |
344344
node ./tools/local-env/scripts/docker.js ${{ inputs.coverage-report && 'exec' || 'run' }} \
345345
php ./vendor/bin/phpunit \
346-
--verbose \
347346
-c "${PHPUNIT_CONFIG}" \
348347
${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \
349348
${{ inputs.phpunit-test-groups && inputs.php >= '7.3' && '--fail-on-empty-test-suite' || '' }} \
@@ -412,18 +411,18 @@ jobs:
412411
- name: Run AJAX tests
413412
if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
414413
continue-on-error: ${{ inputs.allow-errors }}
415-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax
414+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group ajax
416415

417416
- name: Run ms-files tests as a multisite install
418417
if: ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
419418
continue-on-error: ${{ inputs.allow-errors }}
420-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files
419+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group ms-files
421420

422421
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
423422
- name: Run (Xdebug) tests
424423
if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
425424
continue-on-error: ${{ inputs.allow-errors }}
426-
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
425+
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group xdebug --exclude-group __fakegroup__
427426

428427
- name: Upload test coverage report to Codecov
429428
if: ${{ inputs.coverage-report }}

‎tests/phpunit/multisite10.xml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,7 @@
8181
<file>../../src/wp-includes/rss.php</file>
8282
</exclude>
8383
</source>
84+
<logging>
85+
<junit outputFile="build/logs/junit.xml" />
86+
</logging>
8487
</phpunit>

0 commit comments

Comments
 (0)