Make WordPress Core

Changeset 53922 for trunk


Ignore:
Timestamp:
08/23/2022 01:07:17 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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

PHP 8.2 is expected to be released at the end of November 2022.

Enabling the tests to run in CI on PHP 8.2 allows WordPress core to start getting ready.

As an interim measure, while working through the PHP 8.1 and 8.2 issues, builds against these PHP versions are allowed to fail, so that they don't block PR merges in the Gutenberg project.

Notes:

  • The composer install command for PHP 8.1 was still using the --ignore-platform-reqs option, while that has not been needed anymore for quite a while, so the condition is now reused for PHP 8.2.
  • The --ignore-platform... option used for the install is now made more specific:
    • Composer 2.0 added a --ignore-platform-req=... option to selectively ignore platform requirements.
    • Composer 2.2 then added the ability to only ignore the upper bound of platform requirements by adding the + sign.
  • Xdebug-related tests will not be run on PHP 8.2 at this time as the Docker image for PHP 8.2 does not contain Xdebug yet. Once a stable release of Xdebug 3.2.0 is available, it can be added to the Docker image and the test step can then be enabled for PHP 8.2.

References:

Follow-up to [49077], [49162], [50299], [51588], [51604].

Props jrf, desrosj.
See #56009.

File:
1 edited

Legend:

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

    r53895 r53922  
    3535  # Runs the PHPUnit tests for WordPress.
    3636  #
    37   # Note: Steps running tests for PHP 8.1 jobs are allowed to "continue-on-error".
    38   # This prevents workflow runs from being marked as "failed" when only PHP 8.1 fails.
     37  # Note: Steps running tests on PHP 8.1 + 8.2 are allowed to "continue-on-error" (for now).
     38  # This prevents workflow runs from being marked as "failed" when only PHP 8.1/8.2 fails.
    3939  #
    4040  # Performs the following steps:
     
    6565      fail-fast: false
    6666      matrix:
    67         php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
     67        php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
    6868        os: [ ubuntu-latest ]
    6969        memcached: [ false ]
     
    144144
    145145          # Install using `composer update` as there is no `composer.lock` file.
    146           if [ ${{ env.LOCAL_PHP }} == '8.1-fpm' ]; then
    147             docker-compose run --rm php composer update --ignore-platform-reqs
     146          if [ ${{ env.LOCAL_PHP }} == '8.2-fpm' ]; then
     147            docker-compose run --rm php composer update --ignore-platform-req=php+
    148148          else
    149149            docker-compose run --rm php composer update
     
    195195      - name: Run PHPUnit tests
    196196        if: ${{ matrix.php >= '7.0' }}
    197         continue-on-error: ${{ matrix.php == '8.1' }}
     197        continue-on-error: ${{ matrix.php == '8.1' || matrix.php == '8.2'  }}
    198198        run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
    199199
    200200      - name: Run AJAX tests
    201201        if: ${{ ! matrix.split_slow }}
    202         continue-on-error: ${{ matrix.php == '8.1' }}
     202        continue-on-error: ${{ matrix.php == '8.1' || matrix.php == '8.2' }}
    203203        run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
    204204
    205205      - name: Run ms-files tests as a multisite install
    206206        if: ${{ matrix.multisite && ! matrix.split_slow }}
    207         continue-on-error: ${{ matrix.php == '8.1' }}
     207        continue-on-error: ${{ matrix.php == '8.1' || matrix.php == '8.2' }}
    208208        run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
    209209
    210210      - name: Run external HTTP tests
    211211        if: ${{ ! matrix.multisite && ! matrix.split_slow }}
    212         continue-on-error: ${{ matrix.php == '8.1' }}
     212        continue-on-error: ${{ matrix.php == '8.1' || matrix.php == '8.2' }}
    213213        run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
    214214
    215215      # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
    216       - name: Run (xDebug) tests
    217         if: ${{ ! matrix.split_slow }}
     216      - name: Run (Xdebug) tests
     217        if: ${{ ! matrix.split_slow && matrix.php != '8.2' }}
    218218        continue-on-error: ${{ matrix.php == '8.1' }}
    219219        run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
Note: See TracChangeset for help on using the changeset viewer.