Skip to content

Commit 2cde404

Browse files
committed
Build/Test Tools: Run the external-http test group first.
Tests in the `external-http` group are skipped by default and only run when explicitly specified using the `--group` flag. In the PHPUnit test workflow, this group is run after the full test suite. Because HTTP requests are made to external sites and APIs, there are occasionally failures due to service or network outatges. This changes the order of the PHPUnit test commands so that the `external-http` group runs first. This ensures the run fails early when there are issues within the `external-http` tests and avoids needlessly running the full test suite. Props desrosj, mukesh27, johnbillion. See #64893, #64894. git-svn-id: https://develop.svn.wordpress.org/trunk@62541 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fb76ccc commit 2cde404

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ jobs:
225225
php -m | grep -i pcov
226226
'
227227
228+
- name: Run external HTTP tests
229+
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
230+
continue-on-error: ${{ inputs.allow-errors }}
231+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http
232+
228233
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }}
229234
continue-on-error: ${{ inputs.allow-errors }}
230235
run: |
@@ -248,11 +253,6 @@ jobs:
248253
continue-on-error: ${{ inputs.allow-errors }}
249254
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files
250255

251-
- name: Run external HTTP tests
252-
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }}
253-
continue-on-error: ${{ inputs.allow-errors }}
254-
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http
255-
256256
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
257257
- name: Run (Xdebug) tests
258258
if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }}

0 commit comments

Comments
 (0)