mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
test(boat): keep remote acceptance extensions in stacked PR
Preserve the two existing additive runtime acceptance suites in the stacked feature PR while keeping browser synchronization fixes in the independently checked core branch. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
da30252a5e
commit
8096727117
2 files changed
-64
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { CommandManagedRuntimeRunner } from "@paperclipai/adapter-utils/command-managed-runtime";
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
@@ -219,44 +218,6 @@ describe.skipIf(!support.supported)("heartbeat runtime execution boundary", () =
|
||||
expectCleanup(input);
|
||||
});
|
||||
|
||||
it.each([true, false])("validates computer worktrees remotely before finalization (matching branch: %s)", async matches => {
|
||||
const { input, adapter } = await fixture();
|
||||
const remoteCwd = "/home/user/paperclip/company/projects/project/task";
|
||||
const runner: CommandManagedRuntimeRunner = {
|
||||
execute: vi.fn(async () => ({ exitCode: 0, signal: null, timedOut: false, pid: null, startedAt: new Date().toISOString(),
|
||||
stdout: matches ? "paperclip/task\n" : "other-task\n", stderr: "" })),
|
||||
};
|
||||
input.workspace.executionTarget = {
|
||||
kind: "remote", transport: "computer", remoteCwd, runner, processRunner: runner,
|
||||
listenerPort: 43100,
|
||||
resourceAuthority: { kind: "computer-owner", computerId: randomUUID(), ownerId: randomUUID(), generation: 1 },
|
||||
fileAuthority: { kind: "remote-persistent", placementId: randomUUID(), root: remoteCwd, agentHome: "/home/user/paperclip/company/agents/agent" },
|
||||
launch: vi.fn(), inspectProcess: vi.fn(async () => ({ running: false, claim: null })),
|
||||
retainWarm: vi.fn(), retire: vi.fn(async () => true), computerTool: { command: "computer", args: [] },
|
||||
};
|
||||
Object.assign(input.workspace.executionWorkspace, {
|
||||
cwd: remoteCwd, worktreePath: remoteCwd, strategy: "git_worktree", branchName: "paperclip/task",
|
||||
});
|
||||
adapter.execute.mockImplementationOnce(async ctx => {
|
||||
expect(ctx.stopRemoteStartup).toBeTypeOf("function");
|
||||
await expect(ctx.stopRemoteStartup!()).rejects.toThrow("Remote startup stop requires a cancelled run");
|
||||
expect(input.services.envOrchestrator.releaseForRun).not.toHaveBeenCalled();
|
||||
return { exitCode: 0, signal: null, timedOut: false };
|
||||
});
|
||||
if (matches) {
|
||||
await expect(executeHeartbeatRuntime(db, input)).resolves.toMatchObject({ dispatched: true });
|
||||
expect(await finalizations()).toMatchObject([{ status: "succeeded" }]);
|
||||
} else {
|
||||
await expect(executeHeartbeatRuntime(db, input)).rejects.toThrow("computer_workspace_branch_mismatch");
|
||||
expect(await finalizations()).toMatchObject([{ status: "failed" }]);
|
||||
}
|
||||
expect(runner.execute).toHaveBeenCalledOnce();
|
||||
expect(runner.execute).toHaveBeenCalledWith(expect.objectContaining({
|
||||
command: "git", args: ["symbolic-ref", "--quiet", "--short", "HEAD"], cwd: remoteCwd, bypassSession: true,
|
||||
}));
|
||||
expectCleanup(input);
|
||||
});
|
||||
|
||||
it("retains a failed sandbox restore even when persisting its receipt throws", async () => {
|
||||
const { input, adapter, run } = await fixture();
|
||||
input.workspace.executionTarget = { kind: "remote", transport: "sandbox", remoteCwd: home };
|
||||
|
||||
Reference in new issue
Block a user