Streamline recurring setup patterns in Behat tests #383
Copy link
Copy link
Closed
7 / 77 of 7 issues completedLabels
scope:testingRelated to testingRelated to testing
Description
The Behat suites of the bundled commands repeat the same setup patterns across many scenarios: installing plugins and themes from WordPress.org, resetting themes, installing a multisite network, and creating fixtures, sites or options one wp process at a time. Each repetition costs between 0.3 and 3 seconds, and together they make up a large share of the total test time.
This tracks dedicated steps and caching that make these patterns cheaper. Each change is measured against the test suites of the bundled commands that use the pattern, comparing GitHub Actions run time and reliability before and after, so we only keep the changes that make a real difference.
Metadata
Metadata
Assignees
Labels
scope:testingRelated to testingRelated to testing
Activity
schlessera commentedon Oct 31, 2026
Each change was measured against the test suites of the bundled commands that use the pattern, with three runs with and without the change each. The numbers are in the pull request descriptions.
Merged:
Given only these installed themes:. −4.7% across the two commands using it, and retried jobs in extension-command went from 7 to 1.Given these setup commands:. −16.2% in cache-command and −14.3% in widget-command, no measurable effect elsewhere. Commands that change how WordPress is loaded, or that exit on their own, cannot share a process.{PLUGIN_DIR}and{THEME_DIR}. −9.4% in scaffold-command, mostly a readability improvement elsewhere.Closed without merging: #377, #379 and #380, which did not make a measurable difference, and in the case of #379 broke scenarios that downgrade WordPress.