aboutsummaryrefslogtreecommitdiff
path: root/test/python
diff options
context:
space:
mode:
authorAlexander Smolyakov <v-asmoliakov@microsoft.com>2023-09-27 21:51:26 +0300
committerGitHub <noreply@github.com>2023-09-27 21:51:26 +0300
commit0d2fc3ad5b9d6bb33a29891c2378a377f0618c9b (patch)
treed955fe79da7e1038a78bfe826c10baa82570dcd6 /test/python
parente7f7d194d634e86b29ed2b74a35dd3c24fa1f7a5 (diff)
[python] Change the `sudo_if` function to avoid issues with Bash (#694)feature_python_1.2.0
* [python] Updated `sudo_if` function - Remove double quotes to avoid issues with string tokenization * Add test scenario * Revert "Add test scenario" This reverts commit 9e62a3797a8f5eddf5c24a6b5fd30bd2c4be8c54. * Update `jupyterlab git` package name * Bump feature version * Test: Install jupyterlab under root user * Refactor changes * Bump patch version * Address review points
Diffstat (limited to 'test/python')
-rwxr-xr-xtest/python/install_additional_jupyterlab.sh2
-rwxr-xr-xtest/python/install_jupyterlab.sh2
-rw-r--r--test/python/install_jupyterlab_debian.sh22
-rw-r--r--test/python/install_jupyterlab_ubuntu.sh22
-rw-r--r--test/python/scenarios.json22
5 files changed, 67 insertions, 3 deletions
diff --git a/test/python/install_additional_jupyterlab.sh b/test/python/install_additional_jupyterlab.sh
index a5658f0..58c4f7f 100755
--- a/test/python/install_additional_jupyterlab.sh
+++ b/test/python/install_additional_jupyterlab.sh
@@ -17,7 +17,7 @@ packages="$(python3 -m pip list)"
check "location" grep jupyter <<< "$packages"
# Check for git extension
-check "jupyterlab-git" grep jupyterlab-git <<< "$packages"
+check "jupyterlab_git" grep jupyterlab_git <<< "$packages"
# Check for correct JupyterLab configuration
check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py
diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh
index a5658f0..58c4f7f 100755
--- a/test/python/install_jupyterlab.sh
+++ b/test/python/install_jupyterlab.sh
@@ -17,7 +17,7 @@ packages="$(python3 -m pip list)"
check "location" grep jupyter <<< "$packages"
# Check for git extension
-check "jupyterlab-git" grep jupyterlab-git <<< "$packages"
+check "jupyterlab_git" grep jupyterlab_git <<< "$packages"
# Check for correct JupyterLab configuration
check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py
diff --git a/test/python/install_jupyterlab_debian.sh b/test/python/install_jupyterlab_debian.sh
new file mode 100644
index 0000000..3db7fd4
--- /dev/null
+++ b/test/python/install_jupyterlab_debian.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# Check for an installation of JupyterLab
+check "version" jupyter lab --version
+
+# Check location of JupyterLab installation
+packages="$(python3 -m pip list)"
+check "location" grep jupyter <<< "$packages"
+
+# Check for git extension
+check "jupyterlab_git" grep jupyterlab_git <<< "$packages"
+
+# Check for correct JupyterLab configuration
+check "config" grep ".*.allow_origin = '*'" /root/.jupyter/jupyter_server_config.py
+
+# Report result
+reportResults
diff --git a/test/python/install_jupyterlab_ubuntu.sh b/test/python/install_jupyterlab_ubuntu.sh
new file mode 100644
index 0000000..3db7fd4
--- /dev/null
+++ b/test/python/install_jupyterlab_ubuntu.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+# Check for an installation of JupyterLab
+check "version" jupyter lab --version
+
+# Check location of JupyterLab installation
+packages="$(python3 -m pip list)"
+check "location" grep jupyter <<< "$packages"
+
+# Check for git extension
+check "jupyterlab_git" grep jupyterlab_git <<< "$packages"
+
+# Check for correct JupyterLab configuration
+check "config" grep ".*.allow_origin = '*'" /root/.jupyter/jupyter_server_config.py
+
+# Report result
+reportResults
diff --git a/test/python/scenarios.json b/test/python/scenarios.json
index c3c1a82..c3c55d5 100644
--- a/test/python/scenarios.json
+++ b/test/python/scenarios.json
@@ -53,5 +53,25 @@
"features": {
"python": "3.10"
}
+ },
+ "install_jupyterlab_debian": {
+ "image": "debian:bullseye-slim",
+ "features": {
+ "python": {
+ "version": "3.11",
+ "installJupyterlab": true,
+ "configureJupyterlabAllowOrigin": "*"
+ }
+ }
+ },
+ "install_jupyterlab_ubuntu": {
+ "image": "ubuntu:focal",
+ "features": {
+ "python": {
+ "version": "3.11",
+ "installJupyterlab": true,
+ "configureJupyterlabAllowOrigin": "*"
+ }
+ }
}
-} \ No newline at end of file
+}