Skip to content

Real-WordPress PHP smoke harness needs a deterministic bootstrap contract #1015

@chubes4

Description

@chubes4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions