testing personalize
This commit is contained in:
@@ -31,21 +31,31 @@ describe("personalize", async () => {
|
||||
]);
|
||||
});
|
||||
|
||||
// it("runs with personalize script", async () => {
|
||||
// const state = await runTerraformApply(import.meta.dir, {
|
||||
// agent_id: "foo",
|
||||
// });
|
||||
// const instance = findResourceInstance(state, "coder_script");
|
||||
// const id = await runContainer("alpine");
|
||||
// const resp = await execContainer(id, ["sh", "-c", "touch ~/personalize && echo \"echo test\" > ~/personalize && chmod +x ~/personalize &&" + instance.script]);
|
||||
// const stdout = resp.stdout.trim().split("\n");
|
||||
// console.log("====== resp ==== stdout (", resp.exitCode, "):");
|
||||
// console.log(resp.stdout);
|
||||
// console.log("====== resp ==== stderr:");
|
||||
// console.log(resp.stderr);
|
||||
// console.log("======");
|
||||
// // const stderr = resp.stderr.trim().split("\n");
|
||||
// expect(resp.exitCode).toBe(0);
|
||||
// expect(stdout).toEqual([""]);
|
||||
// });
|
||||
it("runs with personalize script", async () => {
|
||||
const state = await runTerraformApply(import.meta.dir, {
|
||||
agent_id: "foo",
|
||||
});
|
||||
const instance = findResourceInstance(state, "coder_script");
|
||||
const id = await runContainer("alpine");
|
||||
const respInit = await execContainer(id, ["sh", "-c", "touch ~/personalize && echo \"echo test\" > ~/personalize && chmod +x ~/personalize && echo \"completed touch cmds\""]);
|
||||
|
||||
console.log("\n id = ", id, "\n")
|
||||
|
||||
console.log("\n====== init ==== stdout (", respInit.exitCode, "):");
|
||||
console.log(respInit.stdout);
|
||||
console.log("====== init ==== stderr:");
|
||||
console.log(respInit.stderr);
|
||||
console.log("======");
|
||||
const resp = await execContainer(id, ["sh", "-c", instance.script]);
|
||||
console.log("====== resp ==== stdout (", resp.exitCode, "):");
|
||||
console.log(resp.stdout);
|
||||
console.log("====== resp ==== stderr:");
|
||||
console.log(resp.stderr);
|
||||
console.log("======");
|
||||
// await new Promise((resolve) => setTimeout(resolve, 100000000000));
|
||||
const stdout = resp.stdout.trim().split("\n");
|
||||
const stderr = resp.stderr.trim().split("\n");
|
||||
expect(resp.exitCode).toBe(0);
|
||||
expect(stdout).toEqual([""]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user