Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit d130fae

Browse files
authored
Add test where jupyter-lab is preinstalled
Not sure if this actually runs, since the tests appear commented out.
1 parent 2c8bf9f commit d130fae

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

jupyterlab/main.test.ts

+24
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ const executeScriptInContainerWithPip = async (
3333
};
3434
};
3535

36+
// executes the coder script after installing jupyterlab
37+
const executeScriptInContainerWithJupyterLabInstalled = async (
38+
state: TerraformState,
39+
image: string,
40+
shell = "sh",
41+
): Promise<{
42+
exitCode: number;
43+
stdout: string[];
44+
stderr: string[];
45+
}> => {
46+
const instance = findResourceInstance(state, "coder_script");
47+
const id = await runContainer(image);
48+
const respPipx = await execContainer(id, [shell, "-c", "apk add pipx"]);
49+
const respPipInstall = await execContainer(id, [shell, "-c", "pipx install jupyterlab"]);
50+
const resp = await execContainer(id, [shell, "-c", instance.script]);
51+
const stdout = resp.stdout.trim().split("\n");
52+
const stderr = resp.stderr.trim().split("\n");
53+
return {
54+
exitCode: resp.exitCode,
55+
stdout,
56+
stderr,
57+
};
58+
};
59+
3660
// executes the coder script after installing pip
3761
const executeScriptInContainerWithUv = async (
3862
state: TerraformState,

0 commit comments

Comments
 (0)