mirror of
https://github.com/stablyai/orca.git
synced 2026-09-28 16:02:45 +00:00
test(runtime): supply the host home the SSH orphan-cleanup gate now requires
The scenario registers an SSH filesystem provider directly. In production that provider is minted by the relay session that also reports the host's `$HOME`, so the test has to supply the other half rather than rely on the recursive-delete gate falling open on an unknown home.
This commit is contained in:
+6
@@ -35,6 +35,7 @@ import {
|
|||||||
store
|
store
|
||||||
} from '../orca-runtime-test-fixtures.spec'
|
} from '../orca-runtime-test-fixtures.spec'
|
||||||
import { createWorktreeRemovalRuntime } from '../orca-runtime-test-scenario-builders.spec'
|
import { createWorktreeRemovalRuntime } from '../orca-runtime-test-scenario-builders.spec'
|
||||||
|
import { setWorktreeRemovalSshHostHomeResolver } from '../../worktree-removal-execution-host-route'
|
||||||
|
|
||||||
describe('OrcaRuntimeService', () => {
|
describe('OrcaRuntimeService', () => {
|
||||||
it('force-deletes a preserved branch on the qualified host when repo ids collide', async () => {
|
it('force-deletes a preserved branch on the qualified host when repo ids collide', async () => {
|
||||||
@@ -453,6 +454,10 @@ describe('OrcaRuntimeService', () => {
|
|||||||
}
|
}
|
||||||
registerSshGitProvider(repo.connectionId, gitProvider as never)
|
registerSshGitProvider(repo.connectionId, gitProvider as never)
|
||||||
registerSshFilesystemProvider(repo.connectionId, fsProvider as never)
|
registerSshFilesystemProvider(repo.connectionId, fsProvider as never)
|
||||||
|
// The recursive-delete gate needs the execution host to have reported its `$HOME`. In
|
||||||
|
// production that comes from the same relay session that minted this fs provider; the test
|
||||||
|
// registers the provider directly, so it has to supply the other half.
|
||||||
|
setWorktreeRemovalSshHostHomeResolver(() => '/remote/home/alice')
|
||||||
const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, {
|
const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, {
|
||||||
getSshProvider: () => ptyProvider as never
|
getSshProvider: () => ptyProvider as never
|
||||||
})
|
})
|
||||||
@@ -460,6 +465,7 @@ describe('OrcaRuntimeService', () => {
|
|||||||
try {
|
try {
|
||||||
await expect(runtime.removeManagedWorktree(`id:${worktreeId}`, true)).resolves.toEqual({})
|
await expect(runtime.removeManagedWorktree(`id:${worktreeId}`, true)).resolves.toEqual({})
|
||||||
} finally {
|
} finally {
|
||||||
|
setWorktreeRemovalSshHostHomeResolver(() => null)
|
||||||
unregisterSshGitProvider(repo.connectionId)
|
unregisterSshGitProvider(repo.connectionId)
|
||||||
unregisterSshFilesystemProvider(repo.connectionId)
|
unregisterSshFilesystemProvider(repo.connectionId)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user