From eb76d52ff4c415d00f462fdc8729d8575a2abcd0 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Fri, 4 Sep 2026 02:15:42 -0400 Subject: [PATCH] test(e2e): pin the hosted mobile WebView SSH spec's unrun status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spec runs in no CI job. It cannot: it needs an iOS simulator and a Docker daemon on one runner, and no GitHub runner has both — the whole hosted-mobile-webview e2e family is manual-only, not just this spec. It already carries the fallback the finding asks for: two test.skip lines naming both missing prerequisites, so it never reports a green skip as coverage. What was only a YAML comment is now a checked contract: the exclusion from the changed-spec lane, the named manual entry points for the dev and packaged runs, and the spec's own refusal to run without either prerequisite. A rename or a dropped skip now reddens instead of quietly changing what CI covers. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- ...d-mobile-webview-ssh-e2e-contract.test.mjs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 config/scripts/hosted-mobile-webview-ssh-e2e-contract.test.mjs diff --git a/config/scripts/hosted-mobile-webview-ssh-e2e-contract.test.mjs b/config/scripts/hosted-mobile-webview-ssh-e2e-contract.test.mjs new file mode 100644 index 00000000000..6089749c5b3 --- /dev/null +++ b/config/scripts/hosted-mobile-webview-ssh-e2e-contract.test.mjs @@ -0,0 +1,44 @@ +import { readFileSync } from 'node:fs' +import { join, resolve } from 'node:path' +import { describe, expect, it } from 'vitest' +import { parse as parseYaml } from 'yaml' + +const projectDir = resolve(import.meta.dirname, '../..') +const SPEC = 'tests/e2e/hosted-mobile-webview-ssh.spec.ts' + +// Why: no GitHub runner offers an iOS simulator and a Docker daemon, so this spec is +// manual-only. Pin the facts that keep "unrun" honest rather than leaving them in a YAML +// comment: it is excluded from the lane that would report a green skip, it has a named +// manual entry point, and it refuses to run itself when either prerequisite is missing. +describe('hosted mobile WebView SSH e2e contract', () => { + const spec = readFileSync(join(projectDir, SPEC), 'utf8') + + it('stays out of the changed-spec lane that cannot run it', () => { + const workflow = parseYaml(readFileSync(join(projectDir, '.github/workflows/e2e.yml'), 'utf8')) + const changedRun = workflow.jobs['changed-e2e'].steps.find( + (step) => step.name === 'Run changed E2E specs' + ) + + expect(changedRun.run).toContain(`. != "${SPEC}"`) + }) + + it('keeps a named manual entry point for both the dev and packaged runs', () => { + const scripts = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf8')).scripts + + expect(scripts['test:e2e:hosted-mobile-webview:ssh']).toContain( + 'run-hosted-mobile-webview-ssh-e2e.mjs' + ) + expect(scripts['test:e2e:hosted-mobile-webview:ssh:packaged']).toContain( + 'run-packaged-hosted-mobile-webview-ssh-e2e.mjs' + ) + }) + + it('refuses to run itself without a Docker daemon or macOS', () => { + expect(spec).toContain( + "test.skip(!RUN_DOCKER_SSH, 'Set ORCA_E2E_SSH_DOCKER=1 to run Docker-backed SSH tests.')" + ) + expect(spec).toContain( + "test.skip(process.platform !== 'darwin', 'Hosted iOS WebView automation requires macOS.')" + ) + }) +})