Files
orca/src/main/node-runtime/managed-runtime-release.test.ts
T
Brennan Benson 48d080e971 feat(acp): a reclamation primitive removes all but the kept managed runtime release (#28507)
* feat(acp): ACP agents can run with a private per-process temp folder

* feat(acp): a reclamation primitive removes all but the kept managed runtime release

The installer calls it while it owns the runtime's installs and launches; it answers the entries it
could not remove so that caller can report them. Nothing calls it from adapter construction.
2026-10-15 18:13:57 -07:00

14 lines
635 B
TypeScript

import { mkdir, mkdtemp, readdir, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { expect, it } from 'vitest'
import { reclaimRuntimeReleases } from './managed-runtime-release'
it('removes every release and leftover but the kept one', async () => {
const root = await mkdtemp(join(tmpdir(), 'orca-runtime-reclaim-'))
await Promise.all(['1.0', '0.9', '.download-1-left'].map((name) => mkdir(join(root, name))))
expect(await reclaimRuntimeReleases(root, '1.0')).toEqual([])
expect(await readdir(root)).toEqual(['1.0'])
await rm(root, { recursive: true, force: true })
})