mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
* Revert "test(ime): restore coverage the composition-ownership change removed (#13168)" This reverts commit25a8c517e1. * Revert "refactor(terminal): return IME composition ownership to xterm (#13128)" This reverts commit17b3dff3c4. * test(ime): keep the architecture-neutral Korean trace coverage The recorded IBus/fcitx5 and Windows MS-Korean traces from #13168 assert PTY byte order, not composition ownership, so they still hold once the terminal composition layer is restored. The mobile accessory-order test pinned the new handleLiveInputChange signature and does not. Co-authored-by: Orca <help@stably.ai> * fix(terminal): keep the macOS Backslash bypass through the revert The restored native-text forwarder only claims keys for input sources in its hardcoded CJK allowlist, so third-party IMEs off that list (Qingg, #10896) still get a raw backslash. #13128 added this bypass as a partial replacement; keep it rather than trade the open issue back. Scoped to the bare backslash key. The rest of shouldBypassXtermForMacNativeText bypassed all unmodified non-ASCII text, which would race the restored forwarder. Co-authored-by: Orca <help@stably.ai> * fix(mobile): move the mirror-step ref write out of render The restored hook assigned runMirrorStepRef during render, which is not replay-safe — React can discard render work, so the mutation can leak from UI that never commits. Its only read is inside the held-commit timer, which fires long after commit, and the ref has a safe default, so an effect is soon enough. Surfaced by the changed-lines React Doctor gate: the rule postdates this code, so restoring the file re-introduced it as a new violation. Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Orca <help@stably.ai>
80 lines
3.0 KiB
JavaScript
80 lines
3.0 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import { join, resolve } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { parse } from 'yaml'
|
|
|
|
const projectDir = resolve(import.meta.dirname, '../..')
|
|
|
|
describe('terminal IME e2e workflow', () => {
|
|
const workflow = parse(
|
|
readFileSync(join(projectDir, '.github/workflows/terminal-ime-e2e.yml'), 'utf8')
|
|
)
|
|
|
|
it('runs only on schedule or manual dispatch', () => {
|
|
expect(workflow.on.pull_request).toBeUndefined()
|
|
expect(workflow.on.workflow_dispatch).toBeNull()
|
|
expect(workflow.on.schedule).toEqual([{ cron: '30 9 * * *' }])
|
|
})
|
|
|
|
it('installs native IBus Hangul and X11 input tools', () => {
|
|
const runs = workflow.jobs['linux-x11'].steps
|
|
.map((step) => step.run)
|
|
.filter((run) => typeof run === 'string')
|
|
const installRun = runs.find((run) => run.includes('apt-get install'))
|
|
|
|
expect(installRun).toBeDefined()
|
|
expect(installRun).toContain('ibus-hangul')
|
|
expect(installRun).toContain('xdotool')
|
|
expect(installRun).toContain('xfwm4')
|
|
expect(installRun).toContain('xvfb')
|
|
expect(installRun).toContain('dbus-x11')
|
|
expect(installRun).toContain('dconf-gsettings-backend')
|
|
expect(installRun).toContain('libglib2.0-bin')
|
|
})
|
|
|
|
it('runs deterministic boundaries before the real IBus suite', () => {
|
|
const runs = workflow.jobs['linux-x11'].steps
|
|
.map((step) => step.run)
|
|
.filter((run) => typeof run === 'string')
|
|
const deterministicIndex = runs.findIndex((run) =>
|
|
run.includes('terminal-ime-exact-byte.spec.ts')
|
|
)
|
|
const nativeIndex = runs.findIndex((run) => run.includes('test:e2e:terminal-ime-native'))
|
|
|
|
expect(deterministicIndex).toBeGreaterThanOrEqual(0)
|
|
expect(nativeIndex).toBeGreaterThan(deterministicIndex)
|
|
})
|
|
|
|
it('keeps IBus lifecycle scoped to owned processes', () => {
|
|
const runner = readFileSync(
|
|
join(projectDir, 'config/scripts/run-terminal-ibus-hangul-e2e.mjs'),
|
|
'utf8'
|
|
)
|
|
|
|
expect(runner).toContain(
|
|
"['--xim', '--verbose', '--panel=disable', '--emoji-extension=disable']"
|
|
)
|
|
expect(runner).toContain("spawn('xfwm4', ['--compositor=off']")
|
|
expect(runner).toContain("['initial-input-mode', 'hangul']")
|
|
expect(runner).toContain("['hangul-keyboard', '2']")
|
|
expect(runner).toContain("process.kill(-processGroupId, 'SIGTERM')")
|
|
expect(runner).toContain("process.kill(-processGroupId, 'SIGKILL')")
|
|
expect(runner).toContain('const killDeadline = Date.now() + processKillTimeoutMs')
|
|
expect(runner).toMatch(
|
|
/'test:e2e:headful',\s*'--workers=1',\s*'--',\s*'tests\/e2e\/terminal-ibus-hangul-native\.spec\.ts'/
|
|
)
|
|
expect(runner).not.toContain("'--replace'")
|
|
expect(runner).not.toContain('killall')
|
|
expect(runner).not.toContain('pkill')
|
|
})
|
|
|
|
it('bounds blocking native input commands', () => {
|
|
const nativeSpec = readFileSync(
|
|
join(projectDir, 'tests/e2e/terminal-ibus-hangul-native.spec.ts'),
|
|
'utf8'
|
|
)
|
|
|
|
expect(nativeSpec.match(/timeout: NATIVE_COMMAND_TIMEOUT_MS/g)).toHaveLength(3)
|
|
})
|
|
})
|