Skip to content

test(e2e): Open Enclave e2e terminals in the fixture on macOS - #32

Open
cdamus wants to merge 2 commits into
eclipse-enclave:mainfrom
cdamus:issues/29-e2e-terminal-windows
Open

cdamus wants to merge 2 commits into
eclipse-enclave:mainfrom
cdamus:issues/29-e2e-terminal-windows

Conversation

@cdamus

@cdamus cdamus commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Fixes #29

The Enclave e2e daemons named their recording terminal in $TERMINAL, which the daemon ignores on macOS. There it opened real Terminal.app windows, and the foreground CLI session spec failed waiting for the fixture's terminal.json. The fixture is now the isolated daemon's custom terminal command in its seeded settings.json, which every platform honors.

Notes for review:

  • enclave-bridge.spec.ts checked the terminal hand-off on Linux only. It checks it on macOS too now.
  • The daemons inherit the runner's environment, where HOMESHELL_SETTINGS_FILE takes precedence over -home-dir. playwright.config.ts clears it, so no e2e daemon reads or writes a settings file that the shell names.
  • Only the e2e setup changes. The daemon is untouched.

Changelog

none

Checklist

  • Tests added: unit and e2e, or a regression test for a bug fix (see AGENTS.md)
    • The change is to the e2e setup. The specs that it fixes and extends on macOS are its tests.
  • Docs updated per the trigger table in AGENTS.md
    • docs/DEV.md describes the terminal fixture.

The Enclave e2e daemons named their recording terminal in $TERMINAL,
which the daemon ignores on macOS. There it opened real Terminal.app
windows instead, and the foreground CLI session spec failed waiting
for the fixture's terminal.json.

Name the fixture as the isolated daemon's custom terminal command in
its settings.json, which every platform honors, and check the
terminal hand-off in enclave-bridge.spec.ts on macOS too.

The daemons inherit the runner's environment, where
HOMESHELL_SETTINGS_FILE takes precedence over -home-dir, so name the
seeded file in their environment as well. DEV.md describes the
terminal fixture.

Fixes eclipse-enclave#29

Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>

@EclipseSourceAI EclipseSourceAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Autonomous AI review. May contain mistakes.

Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.

This agent never approves PRs. A maintainer must sign off.

Only a maintainer can re-request a review from this agent.

Powered by Eclipse Enclave via review-guard-mcp

This PR changes only the e2e setup. Before it, the Enclave e2e daemons found the recording terminal fixture through $TERMINAL. The daemon ignores that variable on macOS (autoEmulator in daemon/internal/terminal/terminal.go), so real Terminal.app windows opened there. Now the seeded settings.json sets terminal.emulator: custom with a command template that runs fixture-terminal {command}. The daemon honors that on every platform: it runs the template via /bin/sh -c with the command shell-quoted. With that in place, the Linux-only check of the terminal hand-off in enclave-bridge.spec.ts now runs on macOS too.

What I checked:

  • The custom template passes validateTerminal: custom is supported on all platforms and the template contains {command}.
  • The quoting holds up. The fixture path is single-quoted for the shell, and customCommand substitutes the HoldOnFailure argv shell-joined, so the existing regex and toContain checks still match what lands in terminal.json.
  • No other e2e code relies on $TERMINAL for the fixture, and docs/DEV.md describes the new setup correctly.
  • changelog: none is right for a test-only change.

I couldn't run the specs: this environment has no Go toolchain and the webapp dependencies aren't installed. Nothing in the UI changed, so there was nothing to check in a browser.

One inline comment, on the extra HOMESHELL_SETTINGS_FILE pin. It only protects the Enclave daemons. The shared daemon and the other isolated daemons are still exposed to a value exported in the runner's shell.

Only the Enclave daemons named their seeded settings file in their
environment. The shared daemon and the other isolated daemons still
inherited a HOMESHELL_SETTINGS_FILE exported in the runner's shell,
which takes precedence over -home-dir, and would have read and written
that file instead. Clear it in playwright.config.ts, which the runner
and every worker evaluate, and drop the Enclave-only pin.

Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>

@EclipseSourceAI EclipseSourceAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Autonomous AI review. May contain mistakes.

Useful comment? React 👍. Disagree? React 👎 to reject it for follow-up reviews. A reply explaining why helps too.

This agent never approves PRs. A maintainer must sign off.

Only a maintainer can re-request a review from this agent.

Powered by Eclipse Enclave via review-guard-mcp

Since my last review, the only change is e295f2b, which moves the HOMESHELL_SETTINGS_FILE clear from the Enclave-only daemon spawn into playwright.config.ts and drops the now-redundant per-daemon pin. I checked the diff and confirmed no other spec sets HOMESHELL_SETTINGS_FILE independently, so this now covers the shared daemon and the other isolated daemons as intended. Nothing else to flag.

These previous comments can be resolved as they are now handled:

I can't resolve them myself as I would need write permission on this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Enclave e2e specs open Terminal.app windows on macOS

2 participants