Add CLI integration test for site start/stop lifecycle#3977
Open
gcsecsey wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
site createintegration test + e2e harness) and complements the UI suite in Add Site Management UI integration tests #3950How AI was used in this PR
I used Claude to write the test and the harness changes, and traced the daemon connection failures to a Unix socket path length limit. I reviewed the diff, ran the suite on nodes 22 and 24, and confirmed that runs are isolated, with no orphan daemons/servers and no temp-dir leaks.
Proposed Changes
We're migrating the legacy blueprint-based start/stop test cases to the CLI integration approach. The existing
start.test.ts/stop.test.tsunit tests mock the daemon and server manager. This PR instead boots a real WordPress server through the process-manager daemon and verifies the live running state viasite list --format json, so it actually exercises the daemon -> server -> port lifecycle.e2e-tagged suite that creates a site with--no-start. It runs in the slower (release/manual) suite, not on every PR.stop --allwould kill the developer's real running sites. The harness now gives each run its own daemon home viaSTUDIO_PROCESS_MANAGER_HOME, so runs are fully isolated and parallel-safe. That home is deliberately kept short and under the temp dir: the daemon's control socket is a Unix domain socket, and nesting it under thestudio-cli-e2e-<uuid>root path overflows macOS's 104-char socket path limit. This surfaces asEINVALon node 24 and as an indefinite connect-retry (hang) on node 22. Windows uses a fixed named pipe, so this isolation is macOS/Linux only.app.jsonso the00-check-studio-compatibilitymigration returns early. Without it, that migration falls through to the developer's real legacy app data and aborts the CLI, so the suite would pass on CI yet fail on a dev machine with Studio installed. This also retroactively hardens thesite createtest from Add CLI integration test for site create (custom name, domain, HTTPS) #3947, which carries the same gap.--runtime sandboxto stay hermetic. The native PHP runtime drives the same lifecycle but downloads its ~25 MB binary into the isolated config dir on the first run. Covering it hermetically needs CI to provision that binary, so native-PHP coverage is a follow-up.Testing Instructions
npm run cli:buildnpm test -- --tagsFilter='e2e' apps/cli/commands/site/tests/start-stop.e2e.test.tsstarts a site,stops a site).Pre-merge Checklist