Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#43240 closed enhancement (fixed)

Exclude third-party code from code coverage reports

Reported by: schlessera's profile schlessera Owned by: johnbillion's profile johnbillion
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

The code coverage currently runs over all files indiscriminately.

For meaningful code coverage reports, we should exclude third-party code, as suggested by @johnbillion in #43067.

The list can be taken from PHPCS exclusion list we already have in Core: https://github.com/WordPress/wordpress-develop/blob/b9b2f2a79d3506a74e3c3ce34de69ed069864dfe/phpcs.xml.dist#L16

Attachments (1)

43240.diff (1.7 KB) - added by schlessera 7 years ago.
Exclusion list taken from PHPCS exclusions

Download all attachments as: .zip

Change History (7)

@schlessera
7 years ago

Exclusion list taken from PHPCS exclusions

#1 @schlessera
7 years ago

  • Keywords has-patch added

Attached a patch that is based on the exclusions already found in https://github.com/WordPress/wordpress-develop/blob/b9b2f2a79d3506a74e3c3ce34de69ed069864dfe/phpcs.xml.dist#L16 .

NOTE: For this to actually work in tests, #43067 needs to already be applied as well.

#2 @johnbillion
7 years ago

  • Milestone changed from Awaiting Review to 5.0
  • Owner set to johnbillion
  • Status changed from new to accepted

#3 @johnbillion
7 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 42665:

Build/Test Tools: Allow code coverage reports to be generated.

This corrects the attribute needed to allow PHPUnit to generate coverage reports, and also adds a blacklist of files and directories that are excluded from coverage reports.

Props schlessera, jipmoors

Fixes #43067, #43240

#4 @johnbillion
7 years ago

In 42666:

Build/Test Tools: Allow code coverage reports to be generated.

This corrects the attribute needed to allow PHPUnit to generate coverage reports, and also adds a blacklist of files and directories that are excluded from coverage reports.

Props schlessera, jipmoors

See #43067, #43240

Merges [42665] to the 4.9 branch.

#5 @jorbin
6 years ago

  • Milestone changed from 5.0 to 5.1

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.