Automattic / Automattic/wp-codebox
PHPUnit workload fails when Composer platform_check references undefined STDERR
- Dominant language
- TypeScript
- Stars
- 16
- Forks
- 4
- Avg merge
- 59m
- Merged PRs (30d)
- 131
Description
## Problem
A `wordpress.phpunit` workload fails before test discovery when a plugin's Composer autoloader includes the generated `vendor/composer/platform_check.php` in WP Codebox Playground.
## Reproduction
From an Extra Chill plugin worktree:
```sh
homeboy review test extrachill-api --path /var/lib/datamachine/workspace/extrachill-api@fix-121-route-affinity
```
WP Codebox 0.12.14 installs Composer autoloaders successfully, then the PHPUnit workload aborts:
```text
Recipe phase run_workloads failed: Recipe workflow steps[0] failed: wordpress.phpunit could not run: Error: Undefined constant \"STDERR\" at /wordpress/wp-content/plugins/extrachill-api/vendor/composer/platform_check.php:17
```
Run metadata:
- Homeboy run: `72c60725-ce63-4e50-9674-698de5c79457`
- WP Codebox runtime: `runtime-mrtlw45h-5gfo5q`
- WP Codebox packages: `0.12.14`
- Failure phase: `run_workloads`
## Expected
The PHPUnit workload should provide CLI standard-stream constants or load Composer autoloaders in a way that does not make a generated platform check crash before test discovery.
## Impact
Valid WordPress plugin tests cannot run in the sandbox whenever Composer generates a platform check that writes to `STDERR` on a failed requirement. The underlying platform-requirement message is also hidden by this secondary fatal error.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the `wordpress.phpunit` workload entry point and reproduce the failure using the provided `homeboy review test` command. Trace when the Composer autoloader and generated `vendor/composer/platform_check.php` are loaded relative to CLI standard-stream setup. Done means PHPUnit reaches test discovery and the underlying platform-requirement message is not hidden by an undefined `STDERR` constant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100