Skip to content

Commit

Permalink
Build/Test Tools: Add an input to allow errors for the PHPUnit workflow.
Browse files Browse the repository at this point in the history
This allows a calling workflow to configure the PHPUnit workflow to `continue-on-error` when one occurs. This is useful for older branches where support for a specific version of PHP was not at 100% within the test suite.

Follow up to [58165], [58269], [58270], [58329].

See #61213.

git-svn-id: https://develop.svn.wordpress.org/trunk@58331 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Jun 4, 2024
1 parent 8e2a83c commit 6765098
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/reusable-phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ on:
required: false
type: 'boolean'
default: false
allow-errors:
description: 'Whether to continue when test errors occur.'
required: false
type: boolean
default: false
env:
LOCAL_PHP: ${{ inputs.php }}-fpm
LOCAL_DB_TYPE: ${{ inputs.db-type }}
Expand Down Expand Up @@ -156,22 +161,27 @@ jobs:
run: npm run env:install

- name: Run PHPUnit tests
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}

- name: Run AJAX tests
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax

- name: Run ms-files tests as a multisite install
if: ${{ inputs.multisite }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ms-files

- name: Run external HTTP tests
if: ${{ ! inputs.multisite }}
continue-on-error: ${{ inputs.allow-errors }}
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http

# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
- name: Run (Xdebug) tests
if: ${{ inputs.php != '8.3' }}
continue-on-error: ${{ inputs.allow-errors }}
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__

- name: Ensure version-controlled files are not modified or deleted
Expand Down

0 comments on commit 6765098

Please sign in to comment.