mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Build/Test Tools: Add input for PHPUnit test group.
This adds a `phpunit-test-goups` input to the reusable PHPUnit test workflow for added flexibility. When passed, only the specified test groups are run. Props jrf. See #52668. git-svn-id: https://develop.svn.wordpress.org/trunk@59251 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
70106015bf
commit
bd8e6504b2
18
.github/workflows/reusable-phpunit-tests-v3.yml
vendored
18
.github/workflows/reusable-phpunit-tests-v3.yml
vendored
@ -42,6 +42,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: 'string'
|
type: 'string'
|
||||||
default: 'phpunit.xml.dist'
|
default: 'phpunit.xml.dist'
|
||||||
|
phpunit-test-groups:
|
||||||
|
description: 'A list of test groups to run.'
|
||||||
|
required: false
|
||||||
|
type: 'string'
|
||||||
|
default: ''
|
||||||
tests-domain:
|
tests-domain:
|
||||||
description: 'The domain to use for the tests'
|
description: 'The domain to use for the tests'
|
||||||
required: false
|
required: false
|
||||||
@ -87,7 +92,7 @@ jobs:
|
|||||||
# - Checks out the WordPress Test reporter repository.
|
# - Checks out the WordPress Test reporter repository.
|
||||||
# - Submit the test results to the WordPress.org host test results.
|
# - Submit the test results to the WordPress.org host test results.
|
||||||
phpunit-tests:
|
phpunit-tests:
|
||||||
name: PHP ${{ inputs.php }} / ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
|
name: PHP ${{ inputs.php }} / ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.phpunit-test-groups && format( ' ({0})', inputs.phpunit-test-groups ) || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
|
|
||||||
@ -162,27 +167,28 @@ jobs:
|
|||||||
- name: Install WordPress
|
- name: Install WordPress
|
||||||
run: npm run env:install
|
run: npm run env:install
|
||||||
|
|
||||||
- name: Run PHPUnit tests
|
- name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}
|
||||||
continue-on-error: ${{ inputs.allow-errors }}
|
continue-on-error: ${{ inputs.allow-errors }}
|
||||||
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
|
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}${{ inputs.phpunit-test-groups && format( ' --group {0}', inputs.phpunit-test-groups ) || '' }}
|
||||||
|
|
||||||
- name: Run AJAX tests
|
- name: Run AJAX tests
|
||||||
|
if: ${{ ! inputs.phpunit-test-groups }}
|
||||||
continue-on-error: ${{ inputs.allow-errors }}
|
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
|
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
|
- name: Run ms-files tests as a multisite install
|
||||||
if: ${{ inputs.multisite }}
|
if: ${{ inputs.multisite && ! inputs.phpunit-test-groups }}
|
||||||
continue-on-error: ${{ inputs.allow-errors }}
|
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
|
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
|
- name: Run external HTTP tests
|
||||||
if: ${{ ! inputs.multisite }}
|
if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups }}
|
||||||
continue-on-error: ${{ inputs.allow-errors }}
|
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
|
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.
|
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
|
||||||
- name: Run (Xdebug) tests
|
- name: Run (Xdebug) tests
|
||||||
if: ${{ inputs.php != '8.4' }}
|
if: ${{ inputs.php != '8.4' && ! inputs.phpunit-test-groups }}
|
||||||
continue-on-error: ${{ inputs.allow-errors }}
|
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__
|
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user