mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-06 15:52:22 +01:00
test: make two test fixtures work on the ubuntu-26.04 runner image
Same fixture change as #21726, so this PR's CI can pass on the ubuntu-26.04 runner image before that PR merges. The stage-runner test uses a standalone sleep binary where /bin/sleep is a multicall binary, and the runner bridge test exits 1 when the shell redirection fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a523a73a05
commit
95d801ee87
2 files changed
+11
-4
No files matched your search
@@ -84,6 +84,12 @@ test("release metadata rejects incompatible native, harness and protocol contrac
|
||||
}
|
||||
});
|
||||
|
||||
async function standaloneSleep() {
|
||||
if (process.platform !== "linux") return "/bin/sleep";
|
||||
const multicall = (await readFile("/bin/sleep")).equals(await readFile("/bin/echo"));
|
||||
return multicall ? "/usr/bin/gnusleep" : "/bin/sleep";
|
||||
}
|
||||
|
||||
async function withOwnedChildren(root, action) {
|
||||
const owned = [];
|
||||
const start = (command, args) => {
|
||||
@@ -112,12 +118,13 @@ async function withOwnedChildren(root, action) {
|
||||
test("atomically publishes while the previous executable is running", { skip: process.platform === "win32", timeout: 15_000 }, async () => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), "runnerd-stage-test-"));
|
||||
const destination = path.join(root, "paperclip-runnerd");
|
||||
const sleep = await standaloneSleep();
|
||||
await withOwnedChildren(root, async start => {
|
||||
await stageRunnerBinary("/bin/sleep", destination);
|
||||
await stageRunnerBinary(sleep, destination);
|
||||
const previous = await stat(destination);
|
||||
const old = start(destination, ["30"]);
|
||||
await old.spawned;
|
||||
await stageRunnerBinary("/bin/sleep", destination);
|
||||
await stageRunnerBinary(sleep, destination);
|
||||
const published = await stat(destination);
|
||||
assert.notEqual(published.ino, previous.ino);
|
||||
assert.equal(published.mode & 0o777, 0o755);
|
||||
@@ -152,7 +159,7 @@ test("a source rebuild selects fresh dev bytes while preserving release binaries
|
||||
await mkdir(path.dirname(built), { recursive: true });
|
||||
await copyHostFixture("/bin/echo", built);
|
||||
const previousBuild = path.join(root, "previous-build");
|
||||
await copyHostFixture("/bin/sleep", previousBuild);
|
||||
await copyHostFixture(await standaloneSleep(), previousBuild);
|
||||
await stageRunnerBinary(previousBuild, hostTarget);
|
||||
await stageRunnerBinary(built, path.join(binaryRoot, "paperclip-runnerd"));
|
||||
const platforms = {}, releaseBytes = new Map();
|
||||
|
||||
@@ -176,7 +176,7 @@ if sys.argv[1] != "completion":
|
||||
expect(await readFile(join(directory, "output.txt"), "utf8")).toBe("hello");
|
||||
const read = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/cat", args: [secret] }, authorize);
|
||||
expect(read).toMatchObject({ exitCode: 1 }); expect(String((read as any).output)).not.toContain("PRIVATE");
|
||||
const write = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/sh", args: ["-c", 'printf stolen > "$1"', "sh", secret] }, authorize);
|
||||
const write = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/sh", args: ["-c", 'printf stolen > "$1" || exit 1', "sh", secret] }, authorize);
|
||||
expect(write).toMatchObject({ exitCode: 1 }); expect(await readFile(secret, "utf8")).toBe("PRIVATE");
|
||||
});
|
||||
it.skipIf(!workspaceCommandSandboxAvailable())("stops its owned process on authority loss and bounds output", async () => {
|
||||
|
||||
Reference in new issue
Block a user