WordPress.org

Make WordPress Core

Changeset 51543


Ignore:
Timestamp:
08/04/2021 06:55:38 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Remove the Composer lock file from version control.

This makes it easier to run unit tests against multiple different PHP versions.

There is currently no reason to have a composer.lock file as:

  • External runtime dependencies are not managed via Composer.
  • Managed updates of the non-runtime dependencies can be done by locking the version used in the composer.json file to a precise version instead of using a composer.lock file.
  • Having the composer.lock file in place makes it a lot more difficult to run the tests against all supported PHP versions.

With these considerations in mind, the lock file is now removed from version control and added to .gitignore and svn:ignore.

Version constraints for the current dev dependencies are adjusted accordingly:

  • PHPUnit now explicitly declares in its version constraints that PHPUnit 5.x, 6.x, and 7.x are supported. The minimum supported version for PHPUnit 5.x has been raised from 5.4 to 5.7, which in practice was already the version used for running the tests on PHP 5.6.
  • PHPCompatibilityWP is effectively updated to version 2.1.2 with the positive impact that a few new constants polyfilled in WP 5.8 are now accounted for (excluded from being flagged).
  • PHP_CodeSniffer is declared as an explicit dependency to ensure that updates to it will always be explicitly managed instead of inherited.
  • The DealerDirect Composer plugin is effectively updated to version 0.7.1 without impact.

Follow-up to [42960], [46290], [47881], [48957].

Props jrf, johnbillion, desrosj, ayeshrajans, aristath, hellofromTonya, SergeyBiryukov.
See #47381.

Location:
trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1111.git
        1212jsdoc
         13composer.lock
        1314vendor
        1415packagehash.txt
  • trunk/.gitignore

    r51501 r51543  
    2020/wp-cli.local.yml
    2121/jsdoc
     22/composer.lock
    2223/vendor
    2324/src/wp-admin/css/*.min.css
  • trunk/composer.json

    r49571 r51543  
    1414    },
    1515    "require-dev": {
    16         "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7.0",
     16        "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
     17        "squizlabs/php_codesniffer": "3.6.0",
    1718        "wp-coding-standards/wpcs": "~2.3.0",
    18         "phpcompatibility/phpcompatibility-wp": "^2.1.0",
    19         "phpunit/phpunit": "^7.5"
     19        "phpcompatibility/phpcompatibility-wp": "~2.1.2",
     20        "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
    2021    },
    2122    "autoload-dev": {
  • trunk/tests/phpunit/includes/bootstrap.php

    r51490 r51543  
    3838$phpunit_version = tests_get_phpunit_version();
    3939
    40 if ( version_compare( $phpunit_version, '5.4', '<' ) || version_compare( $phpunit_version, '8.0', '>=' ) ) {
     40if ( version_compare( $phpunit_version, '5.7', '<' ) || version_compare( $phpunit_version, '8.0', '>=' ) ) {
    4141    printf(
    42         "Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.\n",
     42        "Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.7 and is currently only compatible with PHPUnit up to 7.x.\n",
    4343        $phpunit_version
    4444    );
Note: See TracChangeset for help on using the changeset viewer.