Changeset 51868
- Timestamp:
- 09/24/2021 04:54:42 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.env
r51179 r51868 7 7 # Below, the following substitutions can be made: 8 8 # - '{version}': any major.minor PHP version from 5.2 onwards. 9 # - '{phpunit_version}': any major PHPUnit version starting with 4.10 9 ## 11 10 … … 18 17 # The PHP version to use. Valid options are 'latest', and '{version}-fpm'. 19 18 LOCAL_PHP=latest 20 21 ##22 # The PHPUnit version to use when running tests.23 #24 # Support for new PHPUnit versions is not backported to past versions, so some old WordPress branches require an older25 # version to run tests.26 #27 # Valid versions are:28 # - 'latest' for the highest version of PHPUnit supported on the highest version of PHP supported.29 # - '{version}-fpm' for the highest version of PHPUnit supported on the specified version of PHP.30 # - '{phpunit_version}-php-{version}-fpm' for a specific version of PHPUnit on the specified version of PHP. This format31 # is only available for PHP versions 5.6 and higher.32 #33 # For the full list of available options, see https://hub.docker.com/r/wordpressdevelop/phpunit/tags.34 #35 # For full documentation on PHPUnit compatibility and WordPress versions, see36 # https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/.37 #38 # This defaults to the value assigned to the value of LOCAL_PHP.39 ##40 LOCAL_PHPUNIT=${LOCAL_PHP}41 19 42 20 # Whether or not to enable XDebug. -
trunk/.github/workflows/phpunit-tests.yml
r51736 r51868 192 192 - name: Run slow PHPUnit tests 193 193 if: ${{ matrix.split_slow }} 194 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}194 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 195 195 196 196 - name: Run PHPUnit tests for single site excluding slow tests 197 197 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 198 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required198 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required 199 199 200 200 - name: Run PHPUnit tests for Multisite excluding slow tests 201 201 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 202 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers202 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers 203 203 204 204 - name: Run PHPUnit tests 205 205 if: ${{ matrix.php >= '7.0' }} 206 206 continue-on-error: ${{ matrix.php == '8.1' }} 207 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}207 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} 208 208 209 209 - name: Run AJAX tests 210 210 if: ${{ ! matrix.split_slow }} 211 211 continue-on-error: ${{ matrix.php == '8.1' }} 212 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax212 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 213 213 214 214 - name: Run ms-files tests as a multisite install 215 215 if: ${{ matrix.multisite && ! matrix.split_slow }} 216 216 continue-on-error: ${{ matrix.php == '8.1' }} 217 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files217 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files 218 218 219 219 - name: Run external HTTP tests 220 220 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 221 221 continue-on-error: ${{ matrix.php == '8.1' }} 222 run: node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http222 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http 223 223 224 224 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. … … 226 226 if: ${{ ! matrix.split_slow }} 227 227 continue-on-error: ${{ matrix.php == '8.1' }} 228 run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run --rm phpunitphp ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__228 run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ 229 229 230 230 - name: Ensure version-controlled files are not modified or deleted -
trunk/.github/workflows/test-coverage.yml
r51671 r51868 144 144 - name: Run tests as a single site 145 145 if: ${{ ! matrix.multisite }} 146 run: npm run test:php -composer-- --verbose -c phpunit.xml.dist --coverage-clover wp-code-coverage-single-clover-${{ github.sha }}.xml146 run: npm run test:php -- --verbose -c phpunit.xml.dist --coverage-clover wp-code-coverage-single-clover-${{ github.sha }}.xml 147 147 148 148 - name: Ensure version-controlled files are not modified during the tests … … 158 158 - name: Run tests as a multisite install 159 159 if: ${{ matrix.multisite }} 160 run: npm run test:php -composer-- --verbose -c tests/phpunit/multisite.xml --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml160 run: npm run test:php -- --verbose -c tests/phpunit/multisite.xml --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml 161 161 162 162 - name: Ensure version-controlled files are not modified during the tests -
trunk/docker-compose.yml
r51673 r51868 93 93 init: true 94 94 95 ##96 # The PHPUnit container.97 ##98 phpunit:99 image: wordpressdevelop/phpunit:${LOCAL_PHPUNIT-latest}100 101 networks:102 - wpdevnet103 104 environment:105 - LOCAL_PHP_XDEBUG=${LOCAL_PHP_XDEBUG-false}106 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false}107 - PHP_FPM_UID=${PHP_FPM_UID-1000}108 - PHP_FPM_GID=${PHP_FPM_GID-1000}109 - LOCAL_DIR=${LOCAL_DIR-src}110 - WP_MULTISITE=${WP_MULTISITE-false}111 - GITHUB_REF=${GITHUB_REF-false}112 - GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME-false}113 114 volumes:115 - ./tools/local-env/phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini116 - ./:/var/www117 - phpunit-uploads:/var/www/${LOCAL_DIR-src}/wp-content/uploads118 119 # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.120 init: true121 122 depends_on:123 - mysql124 125 95 volumes: 126 96 # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume. 127 97 mysql: {} 128 # Using a volume for the uploads directory improves PHPUnit performance.129 phpunit-uploads: {}130 98 131 99 networks: -
trunk/package.json
r51719 r51868 171 171 "env:logs": "node ./tools/local-env/scripts/docker.js logs", 172 172 "env:pull": "node ./tools/local-env/scripts/docker.js pull", 173 "test:php": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit", 174 "test:php-composer": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run --rm phpunit php ./vendor/bin/phpunit", 173 "test:php": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit", 175 174 "test:e2e": "node ./tests/e2e/run-tests.js", 176 175 "wp-packages-update": "wp-scripts packages-update"
Note: See TracChangeset
for help on using the changeset viewer.