Skip to content

Retain PHPUnit bootstrap failure diagnostics#1918

Merged
chubes4 merged 1 commit into
mainfrom
fix/1916-retain-runtime-failure-artifacts
Jul 21, 2026
Merged

Retain PHPUnit bootstrap failure diagnostics#1918
chubes4 merged 1 commit into
mainfrom
fix/1916-retain-runtime-failure-artifacts

Conversation

@chubes4

@chubes4 chubes4 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Complete #1916 by registering persisted PHPUnit fatal diagnostics before wp-load.php, then attaching those redacted, bounded diagnostics when Playground returns a nonzero or worker failure with empty stdout, stderr, and body.

This follows #1917 after post-merge verification showed that the worker envelope was preserved but the underlying PHP bootstrap failure remained unavailable.

Closes #1916.

What changed

  • Register a PHPUnit-specific shutdown recorder before the WordPress bootstrap boundary.
  • Persist and attach the diagnostic result before propagating failed Playground responses.
  • Redact nested Playground output summaries before exposing them in errors.
  • Add focused boundary coverage for empty-response propagation, truncation, and redaction.
  • Add a real Playground recipe integration that fatals from an MU plugin during wp-load.php and verifies caller JSON plus persisted artifacts.

How to test

  1. Run npm ci from a fresh checkout.
  2. Run npm run build.
  3. Run npm run test:playground-phpunit-bootstrap-failure-integration and confirm the actual Playground bootstrap-fatal recipe passes its diagnostic assertions.
  4. Run npm run test:phpunit-runtime-failure-diagnostics.
  5. Run npm run test:redaction.
  6. Run npx tsx tests/phpunit-project-autoload.test.ts.

Backwards compatibility

This is additive failure-diagnostic behavior. Successful command results, public command inputs, recipe schemas, and artifact locations are unchanged. Failed PHPUnit commands now include redacted persisted bootstrap diagnostics when native Playground response fields are empty.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-sol via OpenCode
  • Used for: Diagnosed the remaining post-merge bootstrap boundary, implemented the runtime and redaction fixes, added deterministic boundary and live Playground integration coverage, and drafted this PR description; Chris reviews and owns the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve diagnostics when wordpress.phpunit crashes in Playground

1 participant