Make WordPress Core

Changeset 50379


Ignore:
Timestamp:
02/17/2021 07:31:25 PM (3 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/phpunit-tests.yml

    r50299 r50379  
    125125  # - todo: Configure Slack notifications for failing tests.
    126126  test-php:
    127     name: ${{ matrix.php }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
     127    name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
    128128    needs: setup-wordpress
    129129    runs-on: ${{ matrix.os }}
    130130    strategy:
    131131      matrix:
    132         php: [ '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6.20' ]
     132        php: [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
    133133        os: [ ubuntu-latest ]
    134134        memcached: [ false ]
     135        multisite: [ false, true ]
    135136        include:
    136           # Include job for PHP 7.4 with memcached.
     137          # Include jobs for PHP 7.4 with memcached.
    137138          - php: '7.4'
    138139            os: ubuntu-latest
    139140            memcached: true
     141            multisite: false
     142          - php: '7.4'
     143            os: ubuntu-latest
     144            memcached: true
     145            multisite: true
    140146          # Report the results of the PHP 7.4 without memcached job.
    141147          - php: '7.4'
    142148            os: ubuntu-latest
    143149            memcached: false
     150            multisite: false
    144151            report: true
    145152    env:
    146153      LOCAL_PHP: ${{ matrix.php }}-fpm
    147154      LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }}
     155      PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
    148156
    149157    steps:
     
    250258
    251259      - name: Run PHPUnit tests
    252         run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist
     260        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
    253261
    254262      - name: Run AJAX tests
    255         run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group ajax
    256 
    257       - name: Run tests as a multisite install
    258         run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml
    259 
    260       - name: Run AJAX tests as a multisite install
    261         run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ajax
     263        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
    262264
    263265      - name: Run ms-files tests as a multisite install
     266        if: ${{ matrix.multisite }}
    264267        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files
    265268
    266269      - name: Run external HTTP tests
     270        if: ${{ ! matrix.multisite }}
    267271        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http
    268272
    269273      - name: Run REST API tests
     274        if: ${{ ! matrix.multisite }}
    270275        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient
    271276
Note: See TracChangeset for help on using the changeset viewer.