Changeset 59356
- Timestamp:
- 11/05/2024 07:59:49 PM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 19 19 /docker-compose.override.yml 20 20 .env 21 coverage
-
- Property svn:ignore
-
trunk/.gitignore
r59146 r59356 43 43 /artifacts 44 44 /setup.log 45 /coverage 45 46 46 47 # Files and folders that get created in wp-content -
trunk/README.md
r57987 r59356 95 95 ``` 96 96 97 #### Generating a code coverage report 98 PHP code coverage reports are [generated daily](https://github.com/WordPress/wordpress-develop/actions/workflows/test-coverage.yml) and [submitted to Codecov.io](https://app.codecov.io/gh/WordPress/wordpress-develop). 99 100 After the local Docker environment has [been installed and started](#to-start-the-development-environment-for-the-first-time), the following command can be used to generate a code coverage report. 101 102 ``` 103 npm run test:coverage 104 ``` 105 106 The command will generate three coverage reports in HTML, PHP, and text formats, saving them in the `coverage` folder. 107 108 **Note:** xDebug is required to generate a code coverage report, which can slow down PHPUnit significantly. Passing selection-based options such as `--group` or `--filter` can decrease the overall time required but will result in an incomplete report. 109 97 110 #### To restart the development environment 98 111 -
trunk/package.json
r59347 r59356 191 191 "test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js", 192 192 "test:php": "node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit", 193 "test:coverage": "npm run test:php -- --coverage-html ./coverage/html/ --coverage-php ./coverage/php/report.php --coverage-text=./coverage/text/report.txt", 193 194 "test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js", 194 195 "test:visual": "wp-scripts test-playwright --config tests/visual-regression/playwright.config.js", -
trunk/tools/local-env/scripts/docker.js
r59279 r59356 8 8 const composeFiles = local_env_utils.get_compose_files(); 9 9 10 if (process.argv.includes('--coverage-html')) { 11 process.env.LOCAL_PHP_XDEBUG = 'true'; 12 process.env.LOCAL_PHP_XDEBUG_MODE = 'coverage'; 13 } 14 10 15 // Execute any docker compose command passed to this script. 11 16 execSync( 'docker compose ' + composeFiles + ' ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
Note: See TracChangeset
for help on using the changeset viewer.