Make WordPress Core

Opened 4 days ago

Last modified 4 days ago

#65964 new enhancement

Allow the reusable PHPUnit workflow to test another repository

Reported by: lucatume Owned by:
Priority: normal Milestone: Awaiting Review
Component: Build/Test Tools Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

A reusable workflow checks out the repository that calls it, so reusable-phpunit-tests-v3.yml can only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.

Three optional inputs remove the need for one: repository and ref for the checkout, and overlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.

All three inputs default to an empty string, so no existing caller changes behaviour. The overlay is downloaded after the checkout and before the Gutenberg build, and reads through the same same-run artifact mechanism as gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.

PR: https://github.com/WordPress/wordpress-develop/pull/12862

Change History (1)

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


4 days ago
#1

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

A reusable workflow checks out the repository that calls it, so reusable-phpunit-tests-v3.yml can only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.

Three optional inputs remove the need for one: repository and ref for the checkout, and overlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.

## What to check

All three inputs default to an empty string, so no existing caller changes behaviour:

  • repository: ${{ inputs.repository || github.repository }} falls back to github.repository, which is actions/checkout's own default.
  • ref: '' is already actions/checkout's default.
  • the overlay step is guarded by if: inputs.overlay-artifact != ''.

phpunit-tests.yml, test-coverage.yml and every 5.9+ branch calling this workflow at @trunk pass none of them.

The overlay is downloaded after the checkout and before the Gutenberg build, so a caller can't use it to swap out a prepared Gutenberg build. It reads through the same same-run artifact mechanism as gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: analysing the constraint and proposing the diff; I applied and reviewed the change.

Note: See TracTickets for help on using tickets.