Add a CI smoke test for the self-locating bootstrap in an isolated child process
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- php
- Domain
- ci-cd, testing-qa
Research direction
Start with src/Unit/bootstrap.php and src/Integration/bootstrap.php, then inspect the existing GitHub Actions workflows. Run a smoke test without defining the WPMEDIA_PHPUNIT_* or WP_TESTS_DIR constants, requiring a bootstrap and checking both derived constants. Done means CI runs it on every push, a second bootstrap invocation is safe, and regressions fail loudly.
Written by the indexing model from the issue text.
Description
🤖 AI-generated — created by an automated pipeline. Review before acting on this.
Context
PR #55 (issue #52) made src/Unit/bootstrap.php and src/Integration/bootstrap.php self-locating: when WPMEDIA_PHPUNIT_ROOT_DIR is not already defined, each bootstrap now require_onces src/BootstrapManager.php and calls BootstrapManager::setupConstants('unit'|'integration') to derive the two WPMEDIA_PHPUNIT_* constants. This is the exact code path that runs when PHPUnit re-executes the bootstrap standalone in an isolated @runInSeparateProcess child.
However, the package's own test suite cannot exercise this new branch because its bootstraps go through Tests/{Unit,Integration}/init-tests.php, which pre-defines the constants first. This means the self-derivation branch is validated today only by manual smoke testing, not by CI. A regression (e.g., a wrong relative path in the require_once, or a change to getRootDir()/setupConstants()) could silently break isolated-child consumers without any CI signal.
Dependencies
- Issue #52 / PR #55 (the self-locating changes themselves) — should already be merged
What needs to be done
Add a small CI smoke test script (e.g., a standalone PHP script or harness in a dedicated .github/workflows/ step) that:
- Does NOT pre-define
WPMEDIA_PHPUNIT_ROOT_DIR,WPMEDIA_PHPUNIT_ROOT_TEST_DIR, orWP_TESTS_DIR - Requires the self-locating guard logic from
src/Unit/bootstrap.php(orsrc/Integration/bootstrap.php) - Validates the self-derivation behavior
- Consider also testing a synthetic
vendor/wp-media/phpunitconsumer layout to mirror the real isolated-child scenario
Acceptance Criteria
- CI step (or new workflow) runs the smoke test on every push
- Smoke test confirms both
WPMEDIA_PHPUNIT_ROOT_DIRandWPMEDIA_PHPUNIT_ROOT_TEST_DIRare defined after bootstrap require - No fatal "Undefined constant" errors occur during the smoke test
- A second invocation of the bootstrap short-circuits (no double-define errors under
convertWarningsToExceptions) - CI fails loudly if the self-locating behavior regresses
Additional information
This hardens the #52 behavior so it cannot silently regress. It is not a blocker but strongly improves confidence in the isolated-process bootstrap contract for downstream consumers.
Contributes to #30. Follow-up to #52 / PR #55.
- Dominant language
- PHP
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wp-media/phpunit
-
enhancement Made by AI
Difficulty 3/5 1-2 days Newbie friendliness 74/100
-
bug Made by AI
All issues in wp-media/phpunit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100