Make WordPress Core

Changeset 59356 for trunk/README.md


Ignore:
Timestamp:
11/05/2024 07:59:49 PM (15 months ago)
Author:
desrosj
Message:

Build/Test Tools: Add script for generating code coverage report.

This adds documentation for how to generate code coverage reports to the README.md file.

test:coverage has also been added as an npm script to make it easier to generate a report using the local Docker environment. The script will generate an HTML, PHP, and text report file.

Props pbearne, hellofromTonya, netweb.
Fixes #53414.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1919/docker-compose.override.yml
        2020.env
         21coverage
  • trunk/README.md

    r57987 r59356  
    9595```
    9696
     97#### Generating a code coverage report
     98PHP 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
     100After 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```
     103npm run test:coverage
     104```
     105
     106The 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
    97110#### To restart the development environment
    98111
Note: See TracChangeset for help on using the changeset viewer.