Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Fix porter tests on Linux CI

Josh France5d6eb5549f34
diff --git a/test/config.test.ts b/test/config.test.ts
index f91d3df75..76db42942 100644
--- a/test/config.test.ts
+++ b/test/config.test.ts
@@ -494,10 +494,6 @@ test("DEPLOY_PROVIDER=porter refuses to boot without a cluster and tolerates a m
);
});
-test("an unknown DEPLOY_PROVIDER still falls back to docker", () => {
- assert.equal(loadConfig({ DEPLOY_PROVIDER: "nope" }).deployProvider, "docker");
-});
-
test("SANDBOX_BACKEND=porter locates the API and shares the deploy provider's token", () => {
assert.throws(
() => loadConfig({ SANDBOX_BACKEND: "porter", PORTER_DEPLOY_API_TOKEN: "tok" }),
diff --git a/test/secret-schema-drift.test.ts b/test/secret-schema-drift.test.ts
index 847dfb4bb..92a56fc91 100644
--- a/test/secret-schema-drift.test.ts
+++ b/test/secret-schema-drift.test.ts
@@ -98,8 +98,12 @@ test("production rejects weak encryption key material for managed credentials",
});
test("both porter roles share PORTER_DEPLOY_API_TOKEN", () => {
- assert.deepEqual(validateCoreSecretEnv({ SANDBOX_BACKEND: "porter" } as NodeJS.ProcessEnv), ["PORTER_DEPLOY_API_TOKEN"]);
- assert.deepEqual(validateCoreSecretEnv({ DEPLOY_PROVIDER: "porter" } as NodeJS.ProcessEnv), ["PORTER_DEPLOY_API_TOKEN"]);
+ assert.deepEqual(validateCoreSecretEnv({ SANDBOX_BACKEND: "porter" } as NodeJS.ProcessEnv), [
+ "PORTER_DEPLOY_API_TOKEN",
+ ]);
+ assert.deepEqual(validateCoreSecretEnv({ DEPLOY_PROVIDER: "porter" } as NodeJS.ProcessEnv), [
+ "PORTER_DEPLOY_API_TOKEN",
+ ]);
assert.deepEqual(
validateCoreSecretEnv({
SANDBOX_BACKEND: "porter",
diff --git a/test/support/fake-porter.ts b/test/support/fake-porter.ts
index a4a466d3c..b8594009e 100644
--- a/test/support/fake-porter.ts
+++ b/test/support/fake-porter.ts
@@ -78,14 +78,14 @@ export function installFakePorter(opts: FakePorterOptions = {}): FakePorter {
const bodyById = (id: string): [string, BodyRecord] | undefined => [...bodies.entries()].find(([, b]) => b.id === id);
const remap = (b: BodyRecord, script: string): string => {
- const remapTmp = new RegExp(`${escapeRe(b.home)}/tmp/|/tmp/`, "g");
+ const remapTmp = new RegExp(`${escapeRe(GUEST_HOME)}/tmp/|/tmp/`, "g");
let out = script
.replace(/\btimeout (?:-k \d+ )?\d+ /g, "")
+ .replace(remapTmp, `${b.tmp}/`)
.replace(pathRe(GUEST_HOME), b.home)
.replace(pathRe(GUEST_APP), b.app);
for (const [guest, dir] of Object.entries(b.mounts))
if (guest !== GUEST_HOME) out = out.replace(pathRe(guest), dir);
- out = out.replace(remapTmp, `${b.tmp}/`);
return `export HOME=${JSON.stringify(b.home)}; ${out}`;
};