placeholder test for jupyterlab with pip

This commit is contained in:
Stephen Kirby
2023-10-10 17:40:43 +00:00
parent a83cd5b140
commit 2f248dd91f
3 changed files with 29 additions and 37 deletions

View File

@@ -6,9 +6,13 @@ import {
testRequiredVariables,
findResourceInstance,
runContainer,
TerraformState,
execContainer,
} from "../test";
const executeScriptInContainer = async (
// executes the coder script after installing pip
const executeScriptInContainerWithPip = async (
state: TerraformState,
image: string,
shell: string = "sh",
@@ -19,6 +23,7 @@ const executeScriptInContainer = async (
}> => {
const instance = findResourceInstance(state, "coder_script");
const id = await runContainer(image);
const respPip = await execContainer(id, [shell, "-c", "apk add py3-pip"]);
const resp = await execContainer(id, [shell, "-c", instance.script]);
const stdout = resp.stdout.trim().split("\n");
const stderr = resp.stderr.trim().split("\n");
@@ -40,9 +45,6 @@ describe("jupyterlab", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
});
const instance = findResourceInstance(state, "coder_script");
const id = await runContainer("alpine");
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(1);
expect(output.stdout).toEqual([
@@ -52,6 +54,12 @@ describe("jupyterlab", async () => {
]);
});
// TODO: Add test that runs with pip
// May be best to use dockerfile
// TODO: Add faster test to run with pip3.
// currently times out.
// it("runs with pip3", async () => {
// ...
// const output = await executeScriptInContainerWithPip(state, "alpine");
// ...
// });
});