Make WordPress Core

Changeset 51588


Ignore:
Timestamp:
08/09/2021 08:03:52 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Enable running the tests on PHP 8.1.

PHP 8.1 is expected to be released at the end of November 2021.

Enabling the tests to run in CI on PHP 8.1 allows us to get WordPress ready in time.

As an interim measure, while working through the PHP 8.1 issues, separate conditional steps are added to run the tests on PHP 8.1 with the continue-on-error option. That allows the test builds to show as "successful" if all non-PHP 8.1 test runs pass.

Follow-up to [51517], [51543], [51545], [51574], [51582], [51586].

Props jrf.
Fixes #53891. See #53635.

Location:
trunk
Files:
3 edited

Legend:

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

    r51545 r51588  
    6464      fail-fast: false
    6565      matrix:
    66         php: [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
     66        php: [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
    6767        os: [ ubuntu-latest ]
    6868        memcached: [ false ]
     
    9696            multisite: false
    9797            report: true
     98
    9899    env:
    99100      LOCAL_PHP: ${{ matrix.php }}-fpm
     
    143144
    144145          # Install using `composer update` as there is no `composer.lock` file.
    145           if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then
     146          if [ ${{ env.LOCAL_PHP }} == '8.1-fpm' ]; then
    146147            docker-compose run --rm php composer update --ignore-platform-reqs
    147148          else
     
    188189
    189190      - name: Run slow PHPUnit tests
    190         if: ${{ matrix.split_slow }}
     191        if: ${{ matrix.php != '8.1' && matrix.split_slow }}
    191192        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
    192193
     
    200201
    201202      - name: Run PHPUnit tests
    202         if: ${{ matrix.php >= '7.0' }}
     203        if: ${{ matrix.php >= '7.0' && matrix.php != '8.1' }}
    203204        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
    204205
    205206      - name: Run AJAX tests
    206         if: ${{ ! matrix.split_slow }}
     207        if: ${{ matrix.php != '8.1' && ! matrix.split_slow }}
    207208        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
    208209
    209210      - name: Run ms-files tests as a multisite install
    210         if: ${{ matrix.multisite && ! matrix.split_slow }}
     211        if: ${{ matrix.php != '8.1' && matrix.multisite && ! matrix.split_slow }}
    211212        run: npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
    212213
    213214      - name: Run external HTTP tests
    214         if: ${{ ! matrix.multisite && ! matrix.split_slow }}
     215        if: ${{ matrix.php != '8.1' && ! matrix.multisite && ! matrix.split_slow }}
    215216        run: npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
    216217
    217218      # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
    218219      - name: Run (xDebug) tests
    219         if: ${{ ! matrix.split_slow }}
     220        if: ${{ matrix.php != '8.1' && ! matrix.split_slow }}
    220221        run: LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
     222
     223      #### Duplicate set of test runs specifically for PHP 8.1 while WP is not yet compatible. ####
     224      # Splitting off the test runs for PHP 8.1 allows us to apply "continue-on-error" to the job steps,
     225      # which will prevent the builds from showing as "failed" when they only fail on PHP 8.1.
     226      # This block should be removed once all PHP 8.1 test failures have been fixed.
     227      # When the block is removed, the conditions in the block above should also be adjusted back
     228      # to their original values.
     229      - name: Run slow PHPUnit tests
     230        if: ${{ matrix.php == '8.1' && matrix.split_slow }}
     231        continue-on-error: true
     232        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
     233
     234      - name: Run PHPUnit tests
     235        if: ${{ matrix.php == '8.1' }}
     236        continue-on-error: true
     237        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
     238
     239      - name: Run AJAX tests
     240        if: ${{ matrix.php == '8.1' && ! matrix.split_slow }}
     241        continue-on-error: true
     242        run: npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
     243
     244      - name: Run ms-files tests as a multisite install
     245        if: ${{ matrix.php == '8.1' && matrix.multisite && ! matrix.split_slow }}
     246        continue-on-error: true
     247        run: npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
     248
     249      - name: Run external HTTP tests
     250        if: ${{ matrix.php == '8.1' && ! matrix.multisite && ! matrix.split_slow }}
     251        continue-on-error: true
     252        run: npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
     253
     254      # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
     255      - name: Run (xDebug) tests
     256        if: ${{ matrix.php == '8.1' && ! matrix.split_slow }}
     257        continue-on-error: true
     258        run: LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
     259      #### End of duplicate set of test runs. ####
    221260
    222261      - name: Ensure version-controlled files are not modified or deleted
  • trunk/tools/local-env/php-config.ini

    r46587 r51588  
     1display_errors = On
     2error_reporting = -1
    13upload_max_filesize = 1G
    24post_max_size = 1G
  • trunk/tools/local-env/phpunit-config.ini

    r46587 r51588  
     1display_errors = On
     2error_reporting = -1
    13upload_max_filesize = 1G
    24post_max_size = 1G
Note: See TracChangeset for help on using the changeset viewer.