fix(plugin): guard kubernetes upload edge cases

This commit is contained in:
Dotta
2026-05-13 14:47:48 -05:00
committed by Chris Farhood
parent f8b8303089
commit 1eccb71213
4 changed files with 44 additions and 2 deletions
@@ -2,6 +2,7 @@ import { describe, it, expect } from "vitest";
import plugin, {
buildSandboxExecCommand,
buildSandboxExecShellCommand,
deriveUploadTargetDir,
extractAdapterEnvFromProcess,
} from "../../src/plugin.js";
@@ -179,4 +180,10 @@ describe("plugin", () => {
}),
).toEqual(["/bin/sh", "-lc", "pnpm test -- --runInBand"]);
});
it("derives upload target directories for root and nested paths", () => {
expect(deriveUploadTargetDir("/file")).toBe("/");
expect(deriveUploadTargetDir("/workspace/file")).toBe("/workspace");
expect(deriveUploadTargetDir("relative-file")).toBe(".");
});
});