Skip to content

Commit b8dbe9d

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 db1251c commit b8dbe9d

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
@@ -310,15 +310,14 @@ jobs:
310310
- name: Run external HTTP tests
311311
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
312312
continue-on-error: ${{ inputs.allow-errors }}
313-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http
313+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group external-http
314314

315315
# PHPUnit versions used below PHP 7.3 do not support --fail-on-empty-test-suite.
316316
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }}
317317
continue-on-error: ${{ inputs.allow-errors }}
318318
run: |
319319
node ./tools/local-env/scripts/docker.js ${{ inputs.coverage-report && 'exec' || 'run' }} \
320320
php ./vendor/bin/phpunit \
321-
--verbose \
322321
-c "${PHPUNIT_CONFIG}" \
323322
${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \
324323
${{ inputs.phpunit-test-groups && inputs.php >= '7.3' && '--fail-on-empty-test-suite' || '' }} \
@@ -387,18 +386,18 @@ jobs:
387386
- name: Run AJAX tests
388387
if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
389388
continue-on-error: ${{ inputs.allow-errors }}
390-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax
389+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group ajax
391390

392391
- name: Run ms-files tests as a multisite install
393392
if: ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
394393
continue-on-error: ${{ inputs.allow-errors }}
395-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files
394+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}" --group ms-files
396395

397396
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
398397
- name: Run (Xdebug) tests
399398
if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
400399
continue-on-error: ${{ inputs.allow-errors }}
401-
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
400+
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__
402401

403402
- name: Upload test coverage report to Codecov
404403
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)