Skip to content

Re-add CLI integration test for creating a site from a custom Blueprint - #4124

Merged
gcsecsey merged 5 commits into
trunkfrom
gcsecsey/stu-1871-readd-blueprint-e2e-tests
Jul 13, 2026
Merged

Re-add CLI integration test for creating a site from a custom Blueprint#4124
gcsecsey merged 5 commits into
trunkfrom
gcsecsey/stu-1871-readd-blueprint-e2e-tests

Conversation

@gcsecsey

@gcsecsey gcsecsey commented Jul 8, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

Claude investigated the revert history and the current e2e harness, restored the test from git history, adapted it to the updated harness conventions, and verified all suites locally. I reviewed all changes.

Proposed Changes

PR #3961 added CLI e2e coverage for studio site create --blueprint, but was reverted in #4029 as part of the AINFRA-2588 Windows E2E hang investigation. The actual causes were later found and fixed in #4082. The blueprint tests were not at fault, so this PR re-adds them, updated for the harness as it exists today:

  • The 4 original cases (installTheme, installPlugin, runPHP, wp-cli) now create sites with --runtime sandbox, matching the other CLI e2e suites: it keeps runs hermetic, since native PHP would download its binary into the isolated config dir on first run.
  • Applying a Blueprint boots the process-manager daemon even with --no-start, and since Add CLI e2e tests for site management (rename, PHP version, delete) #3989 each test env gets an isolated daemon — so teardown now runs site stop --all before removing the env, like the start/stop and site-management suites, to avoid orphaning a daemon per case.
  • Re-adds Add CLI integration test for creating a site from a custom Blueprint #3961's harness fix: runCli isolates the legacy Electron appdata dir (E2E + E2E_APP_DATA_PATH). Without it, the Studio-compatibility startup migration finds a developer's real pre-split appdata-v1.json and exits 1, failing every CLI e2e suite locally (CI passes only because agents have no legacy config). This also stops e2e runs from bumping production stats.

Testing Instructions

  1. Build the CLI: npm run cli:build.
  2. Run the new suite:
    npm test -- apps/cli/commands/site/tests/create-blueprint.e2e.test.ts --tagsFilter='e2e'
    Confirm all four tests pass.
  3. Confirm the fast suite is unaffected: npm test -- apps/cli/commands/site/tests --tagsFilter='!e2e' — the e2e cases are skipped.
  4. Regression check for the harness fix — the sibling suites still pass: npm test -- apps/cli/commands/site/tests/create.e2e.test.ts --tagsFilter='e2e' (on a machine with a leftover ~/Library/Application Support/Studio/appdata-v1.json, this fails without the harness change and passes with it).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@gcsecsey
gcsecsey requested a review from gavande1 July 9, 2026 13:38
@gcsecsey
gcsecsey marked this pull request as ready for review July 9, 2026 13:38
@wpmobilebot

wpmobilebot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing a1bd855 vs trunk

app-size

Metric trunk a1bd855 Diff Change
App Size (Mac) 1419.35 MB 1419.35 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk a1bd855 Diff Change
load 751 ms 1119 ms +368 ms 🔴 49.0%

site-startup

Metric trunk a1bd855 Diff Change
siteCreation 6528 ms 6493 ms 35 ms ⚪ 0.0%
siteStartup 2398 ms 2400 ms +2 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Re-introduces CLI end-to-end coverage for creating a site from a custom WordPress Blueprint, using the current CLI e2e harness and ensuring runs are isolated from a developer’s real Studio config/appdata.

Changes:

  • Added a new create-blueprint.e2e.test.ts suite covering studio site create --blueprint for multiple Blueprint step types.
  • Updated the CLI e2e harness to also isolate the legacy Electron appdata directory via E2E + E2E_APP_DATA_PATH.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/cli/commands/site/tests/helpers/cli-e2e.ts Ensures CLI e2e runs isolate legacy Electron appdata to avoid local failures due to pre-split appdata-v1.json.
apps/cli/commands/site/tests/create-blueprint.e2e.test.ts Adds e2e tests that create sites from Blueprint files (theme/plugin install + runPHP + wp-cli).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/cli/commands/site/tests/create-blueprint.e2e.test.ts
Comment thread apps/cli/commands/site/tests/create-blueprint.e2e.test.ts
@gcsecsey
gcsecsey requested a review from a team July 10, 2026 14:08

@gavande1 gavande1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gcsecsey for re-adding these. It makes sense to bring them back now that #4082 fixed the actual cause, and the on-disk assertions give the coverage real teeth. LGTM.

@gcsecsey
gcsecsey merged commit 0d1db70 into trunk Jul 13, 2026
11 checks passed
@gcsecsey
gcsecsey deleted the gcsecsey/stu-1871-readd-blueprint-e2e-tests branch July 13, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants