Problem
The real-WordPress smoke execution environment can have WordPress functions loaded without the smoke being able to rely on the usual bootstrap markers. In Data Machine PR CI, a pure-PHP smoke guarded on defined( 'WPINC' ), but WP functions such as do_action() were already loaded, causing:
Cannot redeclare do_action() (previously declared in /wordpress/wp-includes/plugin.php)
This required changing the smoke to guard every stub with function_exists(). That is reasonable defensively, but the harness contract is ambiguous.
Expected
WP Codebox should document and/or enforce a deterministic contract for real-WordPress PHP smoke execution:
- whether WordPress is fully bootstrapped
- whether
WPINC/ABSPATH are defined
- whether core functions are loaded
- whether pure-PHP smoke files should be skipped, isolated, or run in a non-WP process
Why
Ambiguous partial bootstrap makes standalone smoke tests brittle and creates CI-only failures that are hard to reproduce locally.
Evidence
Data Machine PR: Extra-Chill/data-machine#2638
Initial failure: tests/adjacent-handler-tool-policy-smoke.php redeclared do_action() under WP Codebox real-WP host smoke execution.
Problem
The real-WordPress smoke execution environment can have WordPress functions loaded without the smoke being able to rely on the usual bootstrap markers. In Data Machine PR CI, a pure-PHP smoke guarded on
defined( 'WPINC' ), but WP functions such asdo_action()were already loaded, causing:Cannot redeclare do_action() (previously declared in /wordpress/wp-includes/plugin.php)This required changing the smoke to guard every stub with
function_exists(). That is reasonable defensively, but the harness contract is ambiguous.Expected
WP Codebox should document and/or enforce a deterministic contract for real-WordPress PHP smoke execution:
WPINC/ABSPATHare definedWhy
Ambiguous partial bootstrap makes standalone smoke tests brittle and creates CI-only failures that are hard to reproduce locally.
Evidence
Data Machine PR: Extra-Chill/data-machine#2638
Initial failure:
tests/adjacent-handler-tool-policy-smoke.phpredeclareddo_action()under WP Codebox real-WP host smoke execution.