#54: resilient undo E2E (preflight skip-guard) — fixes main E2E red #55
Reference in New Issue
Block a user
Delete Branch "s54-undo-e2e-resilience"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes the undo-dependent host E2E resilient to environments where
executeCommand("undo")is non-functional (the failure diagnosed in this issue).Change (test-infra only — no product code)
test/e2e/suite/undoCapable.ts— a runtime preflight probe: edit a scratch buffer →undo→ report whether the buffer was actually restored (memoized per run).undoMarks.test.ts(#38 suite) — gates on the probe viasuiteSetup: runs normally where undo works (full coverage, real regressions still caught), skips with a loudconsole.warn(no silent loss; shows aspending) where it doesn't.Verified
With undo broken locally: the #38 suite skips (1 pending, warning logged) and both E2E passes exit 0 —
mainE2E is no longer false-red.Scope / what remains
undonon-functionality in this harness persists (likely a headless/VS Code-version limitation); apply the samesuiteSetupguard to the #40 suite whens40-undo-provenancelands, and #40's undo behavior is covered wherever undo works.pretest:e2edoesn't cleanout/— compiled*.test.jsfrom other branches linger and get run by the glob (caused confusing cross-branch failures). Worth adding a clean step.undois broken e53f0c30ad`executeCommand("undo")` is non-functional in some headless `.vscode-test` instances (it does not restore the buffer — see #54's diagnosis), which false-fails every undo-dependent host E2E and turns `main`'s E2E red there even though the product code is fine. Add a RUNTIME preflight probe (`undoCapable.ts`): edit a scratch buffer, undo, and report whether the buffer was actually restored (memoized per run). The #38 undoMarks suite gates on it via `suiteSetup` — running normally where undo works (full coverage preserved, real regressions still caught) and skipping with a LOUD console warning where it doesn't (no false red, no silent loss — the skip is logged and shows as `pending`). This fixes the "main E2E red" symptom. The underlying headless-undo limitation is documented in #54; #40's undo-behavior coverage runs wherever undo works. Test-infra only — no product code changed. Verified: with undo broken locally the #38 suite skips (1 pending) and both E2E passes exit 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>