Tests and checks¶
The plugin has several layers of tests and checks. Each one catches a different kind of mistake, and each one runs with a make target in Docker, so you need only Docker and make. make test runs test-wp and test-wp-ms (the WordPress suites, single site and multisite) at the same time, then test-release, test-readme, test-blueprint and test-wporg-assets. The other layers have their own targets.
The rules for tests (a bug fix needs a failing test, the coverage and mutation floors only go up, how to handle a surviving mutant) are in CONTRIBUTING.md. This page is how to run and read each layer.
flowchart LR
change["A change"] --> static
change --> wp
change --> pkg
change --> browser
change --> sec
subgraph static["Static analysis"]
lint["make lint<br>coding standards"]
stan["make stan<br>types"]
rector["make rector<br>PHP 7.4 syntax"]
api["make check-public-api<br>make check-hooks<br>make check-translations<br>public API, hook docs and bundled translations"]
end
subgraph wp["WordPress tests (PHP 7.4 to 8.5)"]
suite["make test-wp<br>make test-wp-ms<br>behaviour"]
secTests["Security tests<br>capabilities, security tokens, escaping"]
contract["Contract and extension API tests<br>what add-ons rely on"]
bugs["make test-known-bugs<br>open bugs"]
mutation["make mutation<br>would the tests notice a change"]
end
subgraph pkg["The zip"]
dist["make dist-check<br>make dist-repro<br>contents, same bytes"]
install["make test-dist<br>make plugin-check<br>installs, WordPress.org rules"]
end
subgraph browser["Browser"]
a11y["make a11y<br>settings screen"]
flows["make e2e<br>settings, channels, a real update check"]
upgrade["make e2e-upgrade<br>update from 1.6.0, before a release"]
docsa11y["make docs-a11y<br>make docs-links<br>documentation site"]
end
subgraph sec["Security tooling"]
scan["make security<br>workflows, secrets, dependencies, code"]
dast["make dast<br>running site, before a release"]
end
CI runs most of the targets in the diagram on pull requests, but not all of them. make dast (about 11 minutes), make mutation (about 35 minutes), make e2e-upgrade (it downloads 1.6.0 from WordPress.org) and make test-known-bugs (those tests are expected to fail) never run in CI, and neither do make screenshots and make blueprint-smoke, which are not in the diagram. Run the first three before each release (see Releases). A pull request also runs only the jobs its changes can affect: make e2e and make e2e-ms, for example, run only on pull requests that touch the plugin or the files the browser checks use. CONTRIBUTING.md says which checks a pull request runs and how the gate jobs work.
make check runs the checks a pull request must pass, one after the other, and prints one line per step: lint, rector, stan, check-hooks, check-translations, check-public-api, test-wp and test-wp-ms. When a step fails it stops and shows the end of that step's log and how to fix it (make then exits with 2; sh bin/check.sh exits with the step's own code); the full logs are in build/check/<step>.log. make check-full adds quality-check, coverage, sast, taint, a11y, e2e and commits (when the branch has commits over origin/main), and takes several minutes. bin/check.sh is the runner (sh bin/check.sh lint stan runs just those steps) and make test-check tests it. PHP_VERSION and WP_VERSION reach every step.
Claude Code runs a Stop hook (.claude/settings.json, bin/agent-stop-check.sh) at the end of a turn that changed plugin code (includes/, modules/, languages/, wp-updates-notifier.php, uninstall.php). It runs lint, check-hooks, check-public-api and check-translations through bin/check.sh; a failure goes back to Claude, which fixes it before finishing. A step that already passed on the same tree (make check leaves a stamp in build/check/<step>.ok, keyed by the git state) is not run again, and the hook does nothing when no plugin code changed, Docker is not running or vendor/ is missing. To switch it off on your machine, use Claude Code's /hooks menu or set "disableAllHooks": true in .claude/settings.local.json (personal, ignored by git). make test-check tests the hook with a stub make and a stub docker.
Commit message hook. make hooks turns on .githooks/commit-msg, a plain sh check of the first line, the ! and BREAKING CHANGE: rule. It is a strict subset of commitlint.config.js, and make commits stays the authority. make test-commit-msg runs tests/bin/test-commit-msg.sh in the commitlint image and checks that every message the hook accepts also passes commitlint. The release-scripts job runs it.
Pick the PHP and WordPress versions with PHP_VERSION and WP_VERSION (a wordpress-develop tag, or trunk):
make test-wp WP_VERSION=6.7.9 PHP_VERSION=7.4
WordPress tests¶
Covers. Behaviour of the plugin inside a real WordPress: the update check, scheduling, settings and validation, channels and routing, the email channel, the settings screen markup, upgrades from older versions and uninstall. WordPress, its test library and a database come from the Docker setup. There is no real network (every HTTP request must be faked or the test fails) and no real mail.
In CI. The wordpress, wordpress-trunk and random-order jobs of ci.yml keep PHPUnit's output in build/phpunit.log. When a run fails, bin/phpunit-summary.sh writes the failed tests (the N) Class::test entries and the first line of each message) to the job summary, so you find them without opening the log. make test-ci-annotations tests it on a log PHPUnit wrote.
Lives in. tests/wp/, one test-*.php file per area, on tests/wp/class-wpun-test-case.php. Add a file there and it runs: they are found by name.
Run it. make test-wp for a single site, make test-wp-ms for multisite. Three variables narrow the run:
FILE=tests/wp/test-routing.phpruns the one test class in that file. The make target stops with a message if the file does not exist or does not hold exactly one test class.FILTER=Test_Routing::test_nameis a PHPUnit--filterpattern, a regular expression. It may hold characters such as(a|b): it reaches PHPUnit through the environment, so no shell reads it.ARGS=--stop-on-failurepasses any other PHPUnit option.
With FILE and FILTER together, FILTER narrows the class, so it is a pattern for the method name: make test-wp FILE=tests/wp/test-routing.php FILTER=test_name. The same variables work for make test-wp-ms. A passing run prints nothing on standard error; a failing one shows the full PHPUnit report.
make test-slowest runs the single-site suite once and prints the 15 slowest tests. Its JUnit log is build/junit/junit.xml. PHP_VERSION and WP_VERSION pick the versions.
Runs side by side. Every run has a run token: the checkout token (8 digits from the checkout's path), a letter for the suite (s single site, m multisite, c coverage, u mutation, d test-dist, p plugin-check) and a random part made by docker/wp-tests-entrypoint.sh, for example 12345678s_a1b2c3. The table prefix is wptests_<run token>_, and wptests_<run token>_<n>_ for each of Infection's workers (TEST_TOKEN is the worker number, which may be 0). The rules are in docker/wp-tests-prefix.php, tested by make test-isolation. So any two runs, of any suites in any checkouts, use different tables, and two runs of one suite in one checkout are fine too. A run drops its tables when it ends, also when it fails or is stopped with Ctrl-C (docker/wp-tests-drop.php). A run that is killed leaves them until the database container restarts, as its data is in memory. make test-dist and make plugin-check use a database of their own, wordpress_dist_<run token>, and drop it when they end. See decision 0032.
The test database. One MariaDB container serves all checkouts. It is a compose project of its own, wpun-testdb (docker/compose.testdb.yml), and every target that needs it starts it first (make testdb), so make down and make clean leave it running. Stop it by hand with docker compose -f docker/compose.testdb.yml down.
Memory. A test that never stops cannot take the machine down. Core's test bootstrap lifts PHP's memory limit (it sets WP_MEMORY_LIMIT to -1), so tests/bootstrap.php sets it back to 1G (WPUN_TESTS_MEMORY_LIMIT) and WPUN_Test_Case puts it back before each test, because wp_raise_memory_limit() lifts it again: a runaway test stops with "Allowed memory size exhausted". The suite peaks at about 100 MB. The wp-tests container is capped at 2g and the wp-tests-coverage container at 4g, with no swap, and the kernel kills a process that passes the cap (exit 137). WPUN_TEST_MEMORY and WPUN_COVERAGE_MEMORY change the caps, for example WPUN_TEST_MEMORY=3g make test-wp.
Shared helpers. WPUN_Test_Case has helpers to build items, notifications and instances, parse and check markup, and write fixture plugins. tests/README.md lists them.
Multisite. The multisite run has the plugin network-activated, as a network has it. A test class that needs the plugin as one site's copy (the dormant mode, or per-site settings) sets protected $network_activated = false; in WPUN_Test_Case. set_network_activated() switches it inside a test.
CI. The wordpress job in ci.yml runs PHP 7.4 to 8.5 on WordPress 7.1.3, single site and multisite, and PHP 7.4 and 8.3 on WordPress 6.7.9, the oldest supported. On a pull request that cannot affect everything it runs fewer legs (PHP 7.4 and 8.5, single site only). The wordpress-trunk job runs the suite against WordPress trunk every night, on PHP 7.4 and 8.5. The random-order job runs the single-site suite in random order every week and prints the seed.
Coverage¶
Covers. Which lines of the shipped code (wp-updates-notifier.php, uninstall.php, includes/ and modules/; files no test loads count as uncovered) the WordPress suite runs.
Run it. make coverage runs the WordPress suite twice with pcov, as a single site and as a multisite (PHP 8.3 unless PHP_VERSION says otherwise). The code for networks only runs in the multisite suite and the code for single sites only in the first, so bin/coverage-merge.php counts the two runs together. It prints the summary and the five least covered files, writes build/coverage/clover.xml and an HTML report in build/coverage/html/, and fails when line coverage is below COVERAGE_MIN. bin/coverage-check.php computes the percentage from the Clover report, and tests/bin/test-coverage-check.sh tests it. The pcov image is a separate Docker stage, so make test-wp is unchanged.
Changed lines. The total can stay above the floor while a pull request adds code no test runs. make coverage BASE=origin/main also checks the lines the branch changed since it left BASE, committed or not (a new file must be known to git: git add -N). Git runs on the host and writes build/coverage/changes.diff; after the suites, bin/coverage-diff.php lists each added or changed line of includes/, modules/, wp-updates-notifier.php and uninstall.php that Clover marks as executable and not run, as file:line with the line, and the run fails if there is one. A changed PHP file that is not in the report at all is one finding. Both checks run and both results are printed. Without BASE, make coverage is as it was. main against itself passes. tests/bin/test-coverage-diff.sh tests the script (make test-coverage-diff runs it without the suite).
A line that cannot reasonably be tested carries // coverage-ignore -- reason on the same line. The reason is required: a marker without one is a finding of its own. Reviewers see each use in the diff, so use it rarely. A lone continue; line is never reported, because pcov does not reliably mark it as run.
The floor. COVERAGE_MIN is set in the Makefile; it was measured at 97.12% over both suites when last raised. Try a value without editing the file with make coverage COVERAGE_MIN=98. The floor only goes up, and CONTRIBUTING.md says how to raise it.
CI. The coverage job in ci.yml runs make coverage on PHP 8.3 and WordPress 7.1.3 for every pull request that changes code or tests, and keeps the report as the coverage-report artifact for 14 days. On a pull request it runs make coverage BASE=<base commit>, so a pull request with a changed line that no test runs fails too, and the lines are listed in the job log. It is in ci-gate, the required check, so a pull request below the floor or with such a line cannot merge.
Mutation testing¶
Covers. Whether the WordPress tests would fail if the shipped code were wrong. Infection changes the code one small step at a time (a > becomes >=, a continue becomes break, a call is removed), runs the tests that cover the changed line, and reports the changes no test fails on. A mutant that no test fails on has survived: either a test is missing, or the change is one nobody can observe. Coverage says a line ran; this says a test would notice if it were wrong.
Lives in. infection.json5 at the root: the shipped code, the default mutators, the floors, and the mutants that are ignored with a reason. docker/mutation.sh runs it in the wp-tests-coverage image, where Infection is a pinned and checked PHAR (INFECTION_VERSION and INFECTION_SHA256 in docker/Dockerfile, with the steps to verify a new release). It is not a Composer dependency: it needs PHP 8.2, and the project's Composer platform is PHP 7.4. The tests are the WordPress suite, so it needs no tests of its own; a surviving mutant is fixed with a test in tests/wp/.
Run it.
make mutation # everything: about 35 minutes with the default 4 threads on a 16-core machine
make mutation THREADS=12 # more or fewer PHPUnit processes at once (4 by default)
make mutation ARGS="--filter=includes/class-state.php" # one file (--filter also takes a directory); a few minutes
make mutation ARGS="includes/class-state.php includes/class-routing.php" # several files
make mutation-changed # only the PHP files changed under includes/ and modules/ since origin/main; prints the survivors
Only what a change touched. Before a pull request that changes what decides whether a notification is sent (routing, state, delivery, a channel), run make mutation-changed (BASE=origin/main by default, THREADS as for make mutation). Git runs on the host to list the changed PHP files of includes/ and modules/, committed or not; they go to Infection as positional filters, so a change to one file takes about a minute (includes/class-routing.php: 43 seconds). The whole-project floors do not apply and a low score does not fail the run: it prints the score of those files and the surviving mutants (escaped, and not covered) with their diffs, and exits 0 when the run completes. It exits non-zero only when Infection itself fails, for example when a test fails before any mutation. With no changed PHP file it says so and exits 0. Fix a survivor with a test, as below. docker/mutation-changed.sh does the work in the container.
The report is build/infection/infection.log: every surviving mutant with a diff (summary.log and summary.json count them). Each PHPUnit process Infection starts, and the initial test run, gets table prefixes of its own (the run token and the worker number, see Runs side by side), so the processes share one database without touching each other's tables, and so do two mutation runs in different checkouts. The tables are dropped when the run ends. make test-wp is unchanged.
The floors. minMsi and minCoveredMsi in infection.json5; make mutation fails below them. MSI counts the mutants of lines no test runs as missed, covered MSI only those the tests run. The scores were 92.98% (MSI) and 93.52% (covered MSI) when the floors were set, on 5322 mutants of which 150 are ignored. Two full runs of the same code differed by about a point (timing under load), so the floors sit a point below the score. Try a value without editing the file with make mutation ARGS="--min-msi=95".
Baseline. 5322 mutants: 4792 killed, 5 timed out and 12 errored (these count as detected), 333 survived, 30 not covered by any test and 150 ignored; the 35 minutes were with 4 threads. The code that decides whether a notification is sent (what was notified, the active-only filter, routing, reminders, validation of settings, the cron schedule and its repair) scores about 99% when run alone, and no survivor is left there unless it is ignored with a reason. The survivors left are mostly in the channel form, channel store, field renderer and field type code.
Survivors. Read a survivor's diff in the log. What to do with it (write the test, or ignore it with a reason) and when to raise the floors are rules: they are in CONTRIBUTING.md, which also says never to change the plugin to make a mutant go away.
Known limits. It runs a single site, so multisite-only lines are ignored. A lone continue line is never marked as run by pcov, so those mutants are reported as not covered. Code that runs only while WordPress loads, before any test starts (the plugin's hook registration), is mapped to the few tests that boot the plugin again, which is why tests/wp/test-hooks.php boots a fresh Plugin and checks each hook.
CI. None: it takes over 45 minutes on a GitHub runner. Run it on your machine before each release (see Releases), and on the files you changed when you work on the tests.
Security tests¶
Covers. Hostile input and access control: the capability and security token matrix for every admin action, stored and reflected cross-site scripting through names, versions, URLs and settings, secrets that must never reach the page or a log, malformed settings input, and outbound requests. These tests back the threat model.
Lives in. tests/wp/security/, in the security PHPUnit group. They are found automatically, so a new admin action or setting gets a new test in this folder, not a change to a list.
Run it. They run with the rest of the WordPress tests. To run only them: make test-wp ARGS="--group security".
CI. The same wordpress jobs as above. The scanners and the other security checks are on Security checks.
Known-bug tests¶
Covers. A bug that is open and has a test. The test asserts the correct behaviour, so it fails until the bug is fixed.
Lives in. tests/wp/test-known-bugs.php. A test is tagged @group known-bug while its bug is open. phpunit.xml.dist leaves that group out of the normal run, so CI stays green. The fix removes the tag, and the test then runs with everything else and guards against the bug coming back. The group can be empty, which means no known bug has a test waiting.
Run it. make test-known-bugs runs only the tagged tests. They are expected to fail.
CI. No. They are excluded on purpose.
Contract and extension API tests¶
Covers. What other code depends on. The contract tests pin the names and behaviour that existing sites and add-ons use: option names, hook names, the public classes. The extension API tests load a fixture add-on that uses every extension point (channels, item types, routing, configuration sources, the API version check) and the example channel from examples/, so the documented way to extend the plugin is exercised as an add-on author would use it. Changing one of these tests needs an upgrade path and a changelog entry.
Lives in. tests/wp/test-contract.php, tests/wp/test-extension-api.php and tests/wp/test-example-channel.php. The fixture add-on is in tests/fixtures/plugins/wpun-test-addon/.
Two checks guard the same boundary without WordPress. make check-public-api fails if a module, the example channel or the fixture add-on uses anything that is not public API, or if a public class, method or function in includes/ or the main file has no @since tag. make check-hooks fails if a hook the plugin fires has no doc block with @since, or if the hook reference is stale (make hook-docs rewrites it). Both have their own tests in tests/bin/, which the targets run first, so a checker that stopped finding problems would fail too.
make check-translations guards the bundled translations: it fails if a .l10n.php file has a string of the code untranslated, a fuzzy or obsolete entry, a broken placeholder, wrong plural forms, or is not byte for byte what the translations and the code build (a hand edit, or a changed string). It also fails when WP-CLI warns about a string, and on any other file in languages/. So a change to a string needs a translation session before CI is green. Its exporter has its own test in tests/bin/, which the target runs first. See Translations.
CI. The tests run in the wordpress jobs. The checks run in the phpcs job of lint.yml.
Static analysis¶
Covers. Mistakes found without running the code.
make lintruns PHP_CodeSniffer with the WordPress Coding Standards on the plugin, the example add-on and the field showcase. Warnings fail it too.make fixfixes what phpcbf can. WhenGITHUB_ACTIONSis set (CI),bin/lint.shruns all three standards, also writes a Checkstyle report tobuild/phpcs/, andbin/checkstyle-annotations.phpturns it into GitHub annotations (::errorand::warning) on the changed lines, after the normal report. The local output does not change.make test-ci-annotationstests the converter, including that a message cannot inject another workflow command.make stanruns PHPStan at level 8 with the WordPress stubs.phpstan-baseline.neonlists the findings that are accepted for now. It may only shrink: fix a new finding, or annotate it with a reason. In CImake stanpassesGITHUB_ACTIONSon to PHPStan, whose table format then prints annotations as well.make rectoris a dry run that shows any PHP 7.4 syntax upgrade Rector would make. It changes nothing. It fails when the code is behind.make taint(Psalm) andmake sast(Semgrep) are on Security checks.
Lives in. phpcs.xml.dist, phpstan.neon.dist, rector.php and phpstan-baseline.neon in the repository root.
CI. phpcs in lint.yml (with the two checks above), and the phpstan and rector jobs in ci.yml.
Packaging¶
Covers. The zip that users install, as opposed to the repository: that its contents are on the allowlist, that it is reproducible, that it installs, activates, deactivates and uninstalls, that WordPress.org's Plugin Check passes, and that the generated readme.txt, the Live Preview blueprint and the WordPress.org assets are valid. make smoke and make matrix check PHP, the mysqli extension and that every PHP file lints, on one PHP version or on every supported one. make test-release rehearses the scripts the release workflow runs: the copyright year and the signed commit request.
Lives in. bin/ for the scripts, tests/bin/test-release-scripts.sh for the release rehearsal. Each target, and what it checks, is on Packaging.
CI. ci.yml has a job for each: smoke (every PHP version), dist (PHP 7.4 and 8.5, which also runs make test-dist), dist-repro, plugin-check (with check-headers, test-readme, test-blueprint, check-blueprint, test-wporg-assets and wporg-assets-check) and release-scripts.
Browser checks¶
Covers. Accessibility in a real browser, with Playwright and axe: WCAG 2.2 A and AA, and keyboard use. And the flows a person goes through, from the browser to the mail they get. Playwright is pinned by image digest and npm lockfile in tests/e2e/: keep the image tag and @playwright/test at the same version.
Accessibility of the settings screen¶
make a11y (about 40 seconds) builds a throwaway site as its own compose project (wpun-e2e-<token>, from tests/e2e/compose.yml; it never touches make up) and runs Playwright from the official image against the settings screen: axe scans of every view for WCAG 2.2 A and AA, and keyboard checks of the Channels list and a channel form. Specs are in tests/e2e/specs/. Any violation fails the run and is listed with its rule, elements and help text. The HTML report is tests/e2e/reports/html/index.html (the a11y-report artifact when CI fails). Also check new markup by keyboard and with a screen reader: automated checks find only part of the problems.
End-to-end flows¶
make e2e (about 1 minute) drives the plugin the way a user sees it, on a throwaway site of its own (compose project wpun-flows-<token>, files in tests/flows/; it never touches make up, and it does not run beside make a11y in one checkout). It uses the offline fake pending updates of .wordpress-org/blueprint/fake-updates.php (shared with the screenshots and the Playground blueprint) and Mailpit to catch the mail. The cases, one spec file each in tests/flows/specs/:
- Activation schedules the update check.
- The General tab saves, shows an invalid value's error on its own field and logs no console error.
- An email channel is added, edited, tested (the test message arrives), duplicated, disabled, enabled and deleted.
- A real
wp cron event run sc_wpun_update_checksends the expected email (subject, every item, no HTML entities). A core-only channel gets only the WordPress item, a second run sends nothing, Check for updates and notify now shows the right notice, and a due daily reminder repeats what is waiting. - A value set by a constant is read-only on the form and is the one used when sending.
- The fixture add-on (
tests/fixtures/plugins/wpun-test-addon) appears in the module picker.
The Playwright image has no WP-CLI, so the specs call a small server in the WP-CLI container (tests/flows/control.php, on the private network only) that runs real wp commands. Each test starts by putting the site back to a known state (resetSite in tests/flows/specs/helpers.js: it clears the run state, stores the channels and settings the test names, removes SC_WPUN_ constants from wp-config.php, restores the plugins and empties Mailpit), so the specs do not depend on each other, on their order or on the time of day. A new flow gets a case in tests/flows/specs/. Mail is polled in Mailpit with a timeout, never waited for with a sleep.
E2E_KEEP=1 make e2e leaves the site up to look at. FLOWS_ARGS=runs.spec.js make e2e runs one file.
End-to-end flows on a multisite¶
make e2e-ms (about 1 minute) repeats the core path on a multisite with the plugin network-activated (compose project wpun-flows-ms-<token>, from tests/flows/compose.yml plus tests/flows/compose.multisite.yml; it shares the lock of make e2e, so the two do not run at once in one checkout). It checks the settings in the Network Admin stored as network options, one check on the main site, one email that names the network, "active only" counting a plugin active on a sub-site, and a check left on a sub-site clearing itself. It runs only tests/flows/specs/network.spec.js. CI runs it with make e2e.
Upgrade from 1.6.0¶
make e2e-upgrade (about 1 minute) is the upgrade test (#89, #90): it builds the zip with make dist and updates the real 1.6.0 from WordPress.org to it, because the main file was renamed and there is no migration stub. It has its own site (compose project wpun-upgrade-<token>, files in tests/flows/upgrade/, never touches make up) that does not mount the repository:
setup.shinstalls WordPress and 1.6.0 from WordPress.org, so it needs the network.package.phpcopies the zip ofmake distwith its Version header set to 2.0.0 (only the copy is changed) to where the web server serves it.- A must-use plugin offers that copy as the update of
wp-updates-notifier/class-sc-wp-updates-notifier.php, as WordPress.org would, and WordPress's own updater does the rest.
Each test starts from a fresh, configured 1.6.0 (reset.php: the 1.x options notify_to, notify_from, Slack on, a daily check). The stage must-use plugin answers every post to hooks.slack.com itself and records it, so the flow never posts to the real Slack and updates it one way: wp plugin update (WP-CLI, Plugin_Upgrader), "update now" on the Plugins screen (admin-ajax) and the background auto-updater (wp_maybe_auto_update(), which can roll an update back in WordPress 6.6 and later). It checks that the plugin ends at 2.0.0 and deactivated (the Plugins screen says so), with no PHP fatal error and no rollback. It then activates the plugin again with wp plugin activate and checks that:
- the email settings became the
emailchannel with the same address; - the Slack settings are kept as the
slackchannel, no notice about Slack shows and no email about it is sent, and the first run posts to Slack (the recorded post is checked); - the leftover 1.x update check event is kept as the one daily event (not doubled, not stuck in the past);
- a real run mails the migrated address.
It needs the network, so CI does not run it. E2E_KEEP=1 leaves the site up; FLOWS_ARGS=update-cli.spec.js runs one file.
Screenshots¶
make screenshots (about 30 seconds) is not a test: it regenerates the WordPress.org screenshots, .wordpress-org/screenshot-1.png to screenshot-6.png, on a throwaway site of its own (compose project wpun-shots-<token>, files in tests/screenshots/; it never touches make up, and it does not run beside make a11y in one checkout). The data is made up: example.com addresses, and fake plugins whose updates and offline update data come from .wordpress-org/blueprint/fake-updates.php (shared with the Playground blueprint). Mailpit catches the update email. It fails if the update check did not send.
It runs the update check once from WP-CLI before the browser opens any page, and mutes a few items afterwards (tests/screenshots/seed-mutes.sh, plus one mute set in code). Then it photographs the General tab, the Channels list, a channel's form, the Muted tab and the email. A second run breaks the site on purpose (tests/screenshots/seed-health.sh: an overdue check, a failed delivery, a channel without its module, WP-Cron off) and photographs Tools → Site Health. The captions are in .wordpress-org/readme/template.txt, in the same order as SHOTS in tests/screenshots/screenshots.spec.js. Dates and times in the files are those of the run. CI does not run it.
Live Preview blueprint¶
make blueprint-smoke (about 2 minutes) runs the generated Playground blueprint in WordPress Playground CLI (compose project wpun-playground-<token>, files in tests/blueprint-smoke/; it never touches make up), with the plugin taken from the zip of make dist instead of WordPress.org. Playwright then checks that the settings screen shows the demo notice, the Channels tab shows two deliveries as sent, and Tools → Demo emails lists the update emails with the made-up plugins. Playground downloads WordPress on every run, so it needs the network. CI does not run it. See Packaging for the blueprint itself.
The documentation site¶
make docs-a11y builds this documentation site and checks every page in the dark and the light scheme: axe, no request to a third party, visible keyboard focus, and that every Mermaid diagram parses. A syntax error in a diagram fails it, because Mermaid would otherwise draw an error image and the page would still load. Specs are in tests/e2e/docs/specs/. make docs-links checks the links in the built site and in README.md, the generated readme.txt and CONTRIBUTING.md with lychee, including links to other sites. Internal links and anchors are already checked by the strict make docs build. See Documentation site.
A pull request or a push fails on any broken link, a 5xx answer included. The weekly scheduled run sets LINKS_RETRY=1: a site that is briefly down is not a broken link, so when every failed link answered 5xx, bin/docs-links.sh waits LINKS_RETRY_WAIT seconds (60 by default) and runs lychee again on just those links. Only a link that fails twice fails the run. Any other failure (a 404, a timeout) fails at once. The first run writes a JSON report to build/links/, which bin/docs-links.php reads, and the log lists each failed link. make test-docs-links tests this with lychee's own reports and a stub for Docker.
Several worktrees, several runs. Every browser suite runs as a compose project named with the checkout token (for example wpun-e2e-12345678; the token is the one in WPUN_TOKEN, 8 digits from the checkout's path, and a script run by hand computes it). Two worktrees can run the same suite at once without touching each other's site. In one checkout the suites share files, so tests/lib/suite.sh takes a lock in build/locks/: one run at a time of the suites that mount tests/e2e (make a11y, e2e, e2e-ms, e2e-upgrade, screenshots, blueprint-smoke and docs-a11y, which share its node_modules, and make a11y empties its reports), and one make dast. A second run fails at once, before it touches Docker, and the message names the run that holds the lock and its PID. A lock left by a killed run is taken over. With E2E_KEEP=1 or DAST_KEEP=1 the lock is released when the run ends, the site stays up, and the run prints the docker compose down -v command that removes it; the next run of that suite removes it too. make test-browser-suite tests the project name and the lock with a stub docker. The local sites of make up are the one thing worktrees still share: make up, site-setup, wp, wp-ms, down and clean refuse to run in a worktree unless ALLOW_WORKTREE_SITE=1 is set (see Local sites). make test-git-mount tests that guard.
CI. The a11y and e2e jobs in ci.yml run make a11y, and make e2e with make e2e-ms. The docs and links jobs in docs.yml run the two documentation checks. The links job also runs every week, because links to other sites break without a change here.
Scheduled runs¶
A scheduled run that fails tells nobody by itself, so ci.yml, security.yml and docs.yml each have a report job (ci-report, security-report, docs-report) that runs after the gate job, on schedule only. bin/ci-failure-issue.sh opens an issue labelled ci-failure when the gate failed, with the run link and the failed jobs, and comments on it at the next failure. When the gate passes it comments and closes the issue. There is one open issue for each workflow and schedule: ci.yml has two (the nightly trunk run and the weekly random-order run), and one passing never closes the other's. A cancelled or skipped run does nothing. These are the only jobs with issues: write. A schedule runs the workflow from the default branch, so a pull request, a push or a fork never opens an issue. lint.yml has no schedule, so it has no report job. make test-ci-failure-issue tests the script with a stub gh.
Security tooling¶
The things the PHP tests cannot see (the workflows, committed secrets, vulnerable dependencies, unsafe code patterns and the running site) are checked by make security and make dast. Both are on Security checks, with the targets, the CI jobs and the reports.