diff --git a/test/ubicloud-runner.test.ts b/test/ubicloud-runner.test.ts index 4a9e2a04c..bb6e66012 100644 --- a/test/ubicloud-runner.test.ts +++ b/test/ubicloud-runner.test.ts @@ -391,7 +391,6 @@ describe('ubi-runner run, verify and quota against a fake API and a fake ssh', ( 'cmd=${*: -1}\n' + 'printf \'%s\\n\' "$cmd" >> "$root/ssh.log"\n' + 'case "$cmd" in\n' + - ' *-O*) exit 0 ;;\n' + ' *pkill*) echo "$cmd" >> "$root/cancel.log" ;;\n' + ' *captured*) cat > "$root/captured" ;;\n' + ' *"cat > ~/.ubirun-env"*) cat > "$root/ubirun-env" ;;\n' + @@ -458,6 +457,18 @@ describe('ubi-runner run, verify and quota against a fake API and a fake ssh', ( } finally { rmSync(f.root, { recursive: true, force: true }); } }, 60_000); + test('run: the fake ssh dispatches on the remote command, so a checkout whose name holds -O still syncs and runs (GSTA-139)', () => { + const f = fakeVm(); + try { + const checkout = join(f.root, 'ubi-run-O1x2y3'); + mkdirSync(checkout); + const r = run(f, ['run', '--src', checkout, '--', 'make test']); + expect(r.exitCode, r.stderr.toString()).toBe(0); + expect(r.stdout.toString()).toContain('ran: '); + expect(f.ssh()).toContain('tar -xzf - -C work/ubi-run-O1x2y3'); + } finally { rmSync(f.root, { recursive: true, force: true }); } + }, 60_000); + test('run: --pass forwards a named local variable only; UBICLOUD_* and non-names are refused before any API call', () => { const f = fakeVm(); try {