Build/Test Tools: Split the single site and Multisite PHPUnit test runs on CI into separate jobs so they run in parallel.

This reduces the total duration of the test suite from ~26 minutes to ~16 minutes. Hurrah!

Fixes #52548


git-svn-id: https://develop.svn.wordpress.org/trunk@50379 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2021-02-17 19:31:25 +00:00
parent 910c2db68a
commit 4f25e74baa
+16 -11
View File
@@ -124,27 +124,35 @@ jobs:
# - Submit the test results to the WordPress.org host test results.
# - todo: Configure Slack notifications for failing tests.
test-php:
name: ${{ matrix.php }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
needs: setup-wordpress
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [ '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6.20' ]
php: [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
os: [ ubuntu-latest ]
memcached: [ false ]
multisite: [ false, true ]
include:
# Include job for PHP 7.4 with memcached.
# Include jobs for PHP 7.4 with memcached.
- php: '7.4'
os: ubuntu-latest
memcached: true
multisite: false
- php: '7.4'
os: ubuntu-latest
memcached: true
multisite: true
# Report the results of the PHP 7.4 without memcached job.
- php: '7.4'
os: ubuntu-latest
memcached: false
multisite: false
report: true
env:
LOCAL_PHP: ${{ matrix.php }}-fpm
LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }}
PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
steps:
- name: Configure environment variables
@@ -249,24 +257,21 @@ jobs:
run: npm run env:install
- name: Run PHPUnit tests
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
- name: Run AJAX tests
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group ajax
- name: Run tests as a multisite install
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml
- name: Run AJAX tests as a multisite install
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ajax
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
- name: Run ms-files tests as a multisite install
if: ${{ matrix.multisite }}
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files
- name: Run external HTTP tests
if: ${{ ! matrix.multisite }}
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http
- name: Run REST API tests
if: ${{ ! matrix.multisite }}
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.