Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#62296 closed enhancement (fixed)

Update the Test Coverage workflow to utilize the reusabe PHPUnit one

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

Description

The workflow responsible for generating code coverage reports and submitting them to Codecov.io (coverage analysis page) has a few shortcomings. Mainly, the logic for setting up and running PHPUnit tests is duplicated making more work for maintaining.

The workflow should be updated to make use of the reusable-phpunit-tests-v#.yml reusable workflow file.

Other improvements that can be made:

  • There is currently no concurrency configured for this workflow. This prevents multiple workflows for the same change from being run at the same time. For PRs, only the newest one should run, and there should only ever be one running at a time for a specific commit.
  • The workflow currently runs 4 different jobs to generate two report formats each for multisite and single site. PHPUnit supports generating multiple reports at the same time. The number of jobs can be cut in half.
  • The workflow only runs for PRs when related files are changed. But when it runs, the report is not submitted to Codecov.io. This is supported and should be done as a way to fully test the workflow.

Change History (4)

This ticket was mentioned in PR #7631 on WordPress/wordpress-develop by @desrosj.


7 months ago
#1

The workflow responsible for generating code coverage reports and submitting them to Codecov.io (coverage analysis page) has a few shortcomings. Mainly, the logic for setting up and running PHPUnit tests is duplicated making more work for maintaining.

The workflow should be updated to make use of the reusable-phpunit-tests-v#.yml reusable workflow file.

Other improvements that can be made:

  • There is currently no concurrency configured for this workflow. This prevents multiple workflows for the same change from being run at the same time. For PRs, only the newest one should run, and there should only ever be one running at a time for a specific commit.
  • The workflow currently runs 4 different jobs to generate two report formats each for multisite and single site. PHPUnit supports generating multiple reports at the same time. The number of jobs can be cut in half.
  • The workflow only runs for PRs when related files are changed. But when it runs, the report is not submitted to Codecov.io. This is supported and should be done as a way to fully test the workflow.

Trac ticket: https://core.trac.wordpress.org/ticket/62296

#2 @desrosj
7 months ago

It also looks like we're not using flags correctly (docs). Only one flag per report is supported, and using the same flag on overlapping results will cause some inaccurate numbers (multisite/single).

It seems that Components are more what we want for multisite/single site.

Last edited 7 months ago by desrosj (previous) (diff)

#3 @desrosj
7 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 59287:

Build/Test Tools: Use the reusable PHPUnit test workflow for coverage.

This updates the Test Coverage workflow to make use of the reusable PHPUnit test workflow to avoid having duplicate code.

concurrency has also been configured for the workflow, and 4 test jobs have been consolidated into 2.

Props jrf.
Fixes #62296.

Note: See TracTickets for help on using tickets.