From fcc072c37d70da1b1d6bf91b3ba3a2c2eff616c8 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sun, 8 Nov 2026 16:50:02 -0800 Subject: [PATCH] test: remove 12 low-value recipe, paste and worker tests (#40041) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- .../structured-worker-fleet-liveness.test.ts | 10 -- .../paste/native-chat-pasted-links.test.ts | 34 ----- .../ephemeral-vm-recipe-timeouts.test.ts | 116 ------------------ 3 files changed, 160 deletions(-) delete mode 100644 src/renderer/src/components/native-chat/paste/native-chat-pasted-links.test.ts delete mode 100644 src/shared/ephemeral-vm-recipe-timeouts.test.ts diff --git a/src/main/runtime/rpc/methods/orchestration/worker/structured-worker-fleet-liveness.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/structured-worker-fleet-liveness.test.ts index 83d6b27877f..efaf9137e9d 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/structured-worker-fleet-liveness.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/structured-worker-fleet-liveness.test.ts @@ -132,16 +132,6 @@ describe('worker-list liveness for chat-mode workers', () => { }).workers[0]! } - it('reports a running Codex worker live and working, with nothing for the coordinator to do', () => { - installHost(record('codex'), true) - const worker = project([sessionStatus('working', NOW - 5 * 60 * 1000)]) - - expect(worker.liveness).toEqual({ verdict: 'live', observedAt: NOW, source: 'execution_host' }) - expect(worker.stage.activity).toBe('working') - expect(worker.evidence.lastObservedAt).toBe(NOW - 5 * 60 * 1000) - expect(worker.attention).toEqual({ categories: [], requiresAction: false }) - }) - it('keeps an idle Claude chat worker live after its last turn is hours old', () => { installHost(record('claude'), true) const worker = project([sessionStatus('done', NOW - 2 * HOUR)]) diff --git a/src/renderer/src/components/native-chat/paste/native-chat-pasted-links.test.ts b/src/renderer/src/components/native-chat/paste/native-chat-pasted-links.test.ts deleted file mode 100644 index 11eb52f9896..00000000000 --- a/src/renderer/src/components/native-chat/paste/native-chat-pasted-links.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// @vitest-environment happy-dom -import { describe, expect, it } from 'vitest' -import { linkedSelectionText, withPastedLinks } from './native-chat-pasted-links' - -describe('withPastedLinks', () => { - it('keeps rich-text links as Markdown around the plain text', () => { - const html = - '

Hey can you take a look at this\n FR and [the] docs?

' - expect(withPastedLinks('Hey can you take a look at this FR and [the] docs?', html)).toBe( - 'Hey can you take a look at [this FR](https://github.com/stablyai/orca/issues/39150) and [\\[the\\] docs](https://example.com/a%28b%29)?' - ) - }) - - it('leaves bare URLs, unsafe schemes and existing Markdown alone', () => { - const html = - 'https://example.com/ run x' - const text = 'https://example.com/ run [x](https://x.dev)' - expect(withPastedLinks(text, html)).toBe(text) - }) -}) - -describe('linkedSelectionText', () => { - it('links the selected words to a pasted URL', () => { - expect(linkedSelectionText('external links', ' https://example.com\n')).toBe( - '[external links](https://example.com)' - ) - }) - - it('replaces instead when the selection or paste is not a word-to-URL pair', () => { - expect(linkedSelectionText('https://old.dev', 'https://new.dev')).toBeNull() - expect(linkedSelectionText('two\nlines', 'https://new.dev')).toBeNull() - expect(linkedSelectionText('words', 'see https://new.dev')).toBeNull() - }) -}) diff --git a/src/shared/ephemeral-vm-recipe-timeouts.test.ts b/src/shared/ephemeral-vm-recipe-timeouts.test.ts deleted file mode 100644 index c618bf299c3..00000000000 --- a/src/shared/ephemeral-vm-recipe-timeouts.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - formatEphemeralVmRecipeTimeout, - getEphemeralVmRecipeTimeoutSeconds, - parseEphemeralVmRecipeTimeoutSeconds, - toEphemeralVmRuntimeRecipeSnapshot -} from './ephemeral-vm-recipe-timeouts' -import { ephemeralVmTimeoutFailure } from './ephemeral-vm-failure-copy' -import type { OrcaVmRecipe } from './orca-yaml-hook-types' -import { parseOrcaYaml } from './orca-yaml' - -describe('ephemeral VM recipe timeouts', () => { - it('applies no limit unless the recipe sets one', () => { - const recipe: OrcaVmRecipe = { id: 'r', name: 'R', create: './create.sh' } - for (const mode of ['create', 'suspend', 'resume', 'destroy'] as const) { - expect(getEphemeralVmRecipeTimeoutSeconds(recipe, mode)).toBeUndefined() - } - expect( - getEphemeralVmRecipeTimeoutSeconds({ ...recipe, timeoutSeconds: { create: 90 } }, 'create') - ).toBe(90) - expect( - getEphemeralVmRecipeTimeoutSeconds({ ...recipe, timeoutSeconds: { create: 90 } }, 'destroy') - ).toBeUndefined() - }) - - it('rejects values that are not whole seconds in range', () => { - for (const value of [0, -1, 1.5, 86_401, '60', [60], { create: '60' }, { create: 0 }]) { - expect(parseEphemeralVmRecipeTimeoutSeconds(value).ok).toBe(false) - } - expect(parseEphemeralVmRecipeTimeoutSeconds({})).toEqual({ ok: true }) - expect(parseEphemeralVmRecipeTimeoutSeconds(86_400)).toMatchObject({ ok: true }) - }) - - it('formats the limit compactly', () => { - expect(formatEphemeralVmRecipeTimeout(45)).toBe('45s') - expect(formatEphemeralVmRecipeTimeout(900)).toBe('15m') - expect(formatEphemeralVmRecipeTimeout(5_400)).toBe('1h 30m') - }) - - it('tells the user which step stopped and how to raise the limit', () => { - expect(ephemeralVmTimeoutFailure('create', 1_800)).toEqual({ - error: - 'The recipe create step did not finish within 30m, so Orca stopped it. Check the recipe output, or raise timeoutSeconds in orca.yaml if it needs longer.', - errorCode: 'recipeTimedOut', - errorParams: { mode: 'create', timeout: '30m', timeoutSeconds: 1_800 } - }) - }) - - it('drops timeoutSeconds from the persisted recipe snapshot', () => { - const snapshot = toEphemeralVmRuntimeRecipeSnapshot({ - id: 'r', - name: 'R', - create: './create.sh', - destroy: './destroy.sh', - timeoutSeconds: { create: 60 } - }) - expect(snapshot).toEqual({ id: 'r', name: 'R', create: './create.sh', destroy: './destroy.sh' }) - }) -}) - -describe('orca.yaml recipe timeoutSeconds', () => { - it('parses recipe timeoutSeconds as one limit or a per-step map', () => { - const yaml = [ - 'environmentRecipes:', - ' - id: all-steps', - ' name: All Steps', - ' create: ./create.sh', - ' timeoutSeconds: 120', - ' - id: per-step', - ' name: Per Step', - ' create: ./create.sh', - ' timeoutSeconds:', - ' create: 1800', - ' destroy: 60' - ].join('\n') - - expect(parseOrcaYaml(yaml)?.environmentRecipes).toEqual([ - { - id: 'all-steps', - name: 'All Steps', - create: './create.sh', - timeoutSeconds: { create: 120, suspend: 120, resume: 120, destroy: 120 } - }, - { - id: 'per-step', - name: 'Per Step', - create: './create.sh', - timeoutSeconds: { create: 1800, destroy: 60 } - } - ]) - }) - - it('keeps a recipe with an invalid timeoutSeconds without limits and reports it', () => { - const yaml = [ - 'environmentRecipes:', - ' - id: cloud-sandbox', - ' name: Cloud Sandbox', - ' create: ./create.sh', - ' timeoutSeconds:', - ' boot: 60' - ].join('\n') - - expect(parseOrcaYaml(yaml)).toEqual({ - scripts: {}, - environmentRecipes: [{ id: 'cloud-sandbox', name: 'Cloud Sandbox', create: './create.sh' }], - environmentRecipeDiagnostics: [ - { - index: 0, - field: 'timeoutSeconds', - message: - 'Recipe "cloud-sandbox" timeoutSeconds.boot is not a lifecycle step; use create, suspend, resume, or destroy. Steps keep no time limit.' - } - ] - }) - }) -})