[codex] Add reparent E2E scenarios#530
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM Findings[MEDIUM] Best-effort rack cleanup can leave persistent test fixtures behind
NotesThe authoritative diff only changes ProtoFleet Playwright E2E code: fixtures, page objects, helpers, and a new Generated by Codex Security Review | |
1447f24 to
2691f13
Compare
There was a problem hiding this comment.
Pull request overview
Adds new ProtoFleet Playwright E2E coverage for “reparent” workflows (rack → building, miner → site, miner → rack), plus a small page-object tweak and a CI workflow adjustment to run the new spec without setup-project dependencies.
Changes:
- Added
minersReparent.spec.tswith three end-to-end reparent scenarios, including setup/cleanup and request-payload assertions. - Updated
RacksPage.clickSaveRack()to scope the “Save” click to the full-screen modal. - Updated the ProtoFleet E2E GitHub Actions workflow to set
PW_UI_NO_DEPS=1for the new spec shard.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
client/e2eTests/protoFleet/spec/minersReparent.spec.ts |
New Playwright spec covering three reparent operator workflows with request + UI assertions. |
client/e2eTests/protoFleet/pages/racks.ts |
Makes rack “Save” interaction more specific by scoping it to the full-screen modal. |
.github/workflows/protofleet-e2e-tests.yml |
Skips setup project dependencies for the new spec shard via PW_UI_NO_DEPS=1. |
| const responsePromise = new Promise<VisibleMinerSnapshot[]>((resolve, reject) => { | ||
| const timeoutId = setTimeout(() => { | ||
| page.off("response", handleResponse); | ||
| resolve([]); | ||
| }, 10000); |
| async function detectSiteManagementMode(page: Page): Promise<SiteManagementMode> { | ||
| await resetActiveSiteSelection(page); | ||
| await openSitesManagementPage(page, "fleet"); | ||
| return "fleet"; | ||
| } | ||
|
|
||
| async function openSitesManagementPage(page: Page, mode: SiteManagementMode) { | ||
| void mode; | ||
| await page.goto("/fleet/sites"); |
| if [ "$MATRIX_SPEC" = "minersReparent.spec.ts" ]; then | ||
| PLAYWRIGHT_BLOB_OUTPUT_FILE="blob-report/${MATRIX_PROJECT}-${SPEC_NAME}.zip" \ | ||
| PWTEST_BLOB_DO_NOT_REMOVE=1 \ | ||
| PW_UI_NO_DEPS=1 \ | ||
| npx playwright test --project="$MATRIX_PROJECT" --reporter=blob "spec/$MATRIX_SPEC" | ||
| else |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2666a50874
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const continueButton = this.page.getByRole("button", { name: "Continue", exact: true }); | ||
| if (await continueButton.isVisible().catch(() => false)) { | ||
| await continueButton.click(); |
There was a problem hiding this comment.
Wait for the site-move conflict dialog
When cleanup restores a miner that originally belonged to another site after the assign-to-rack scenario, the miner is still in the temporary rack/site, so AssignDevicesToSite first returns the cross-site rack conflict and renders a Continue dialog asynchronously. This immediate isVisible() check can run before that dialog appears, causing the helper to return without force-clearing the rack membership; the following cleanup then runs with the modal still open and can leave the miner/rack placement dirty. Wait briefly for either the dialog and click it, or for the picker to close, before returning.
Useful? React with 👍 / 👎.
Reviewable diff: +0/-0 across 0 files (excludes generated, test, and story files).
Summary
This PR adds ProtoFleet E2E coverage for three reparent workflows that operators can trigger from the existing Fleet surfaces: moving a rack to a building, assigning a miner to a site, and assigning a miner to a rack. The spec verifies the network requests and resulting UI state for each flow, while also handling the local dev configuration where multi-site Fleet tabs may be disabled and the legacy sites/settings routes remain the stable management surface.
How it works
The new Playwright spec provisions temporary sites, buildings, and racks as needed, performs the reparent action from the Racks or Miners tab, then validates the request payload sent to the backend and the resulting placement state visible in the app. For local environments where
VITE_MULTI_SITE_ENABLEDis off, setup and cleanup use the legacy/settings/sitesand related site-scoped building surfaces, but the user actions under test still happen from the Fleet Racks and Miners tabs.Diagrams
Areas of the code involved
client/e2eTests/protoFleet/spec/minersReparent.spec.tsKey technical decisions & trade-offs
Testing & validation
./node_modules/.bin/eslint e2eTests/protoFleet/spec/minersReparent.spec.tsPW_UI_NO_DEPS=1 npx playwright test spec/minersReparent.spec.ts --project=desktop