test(e2e): make terminal-attention BEL emission PATH-independent (#1771)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
6e482a00d7
commit
180b5c29a7
|
|
@ -78,11 +78,13 @@ async function activateTerminalTab(page: Page, tabId: string): Promise<void> {
|
|||
}
|
||||
|
||||
async function emitBell(page: Page, ptyId: string): Promise<void> {
|
||||
// Why: `tput bel` is the canonical way to emit BEL from the shell — this is
|
||||
// the exact command the user will run to reproduce the attention path. Prefer
|
||||
// it over `node -e` so the test exercises the same PTY byte stream a real
|
||||
// user sees.
|
||||
await execInTerminal(page, ptyId, `tput bel`)
|
||||
// Why: `printf '\a'` emits a raw BEL byte without depending on terminfo or
|
||||
// PATH-resolved binaries. CI shells can launch with a stripped PATH that
|
||||
// excludes `/usr/bin`, breaking `tput` and silently emitting nothing —
|
||||
// the `bash: groups: command not found` startup output in failure
|
||||
// snapshots is the same symptom. printf is a shell builtin, so it works
|
||||
// even when the PATH is broken.
|
||||
await execInTerminal(page, ptyId, `printf '\\a'`)
|
||||
}
|
||||
|
||||
async function proveShellReadyWithSingleWrite(page: Page, ptyId: string): Promise<void> {
|
||||
|
|
@ -182,11 +184,9 @@ test.describe('Terminal attention', () => {
|
|||
// async PTY pipeline.
|
||||
await emitBell(orcaPage, activePtyId)
|
||||
const MARKER_TITLE = 'focused-tab-bell-marker'
|
||||
await execInTerminal(
|
||||
orcaPage,
|
||||
activePtyId,
|
||||
`node -e "process.stdout.write('\\u001b]0;${MARKER_TITLE}\\u0007')"`
|
||||
)
|
||||
// Why: printf is a shell builtin so it works even when CI launches the
|
||||
// shell with a stripped PATH (no /usr/bin → no `node` resolvable).
|
||||
await execInTerminal(orcaPage, activePtyId, `printf '\\033]0;${MARKER_TITLE}\\007'`)
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
|
|
|
|||
Loading…
Reference in New Issue