diff options
author | Chuck Lantz <clantz@microsoft.com> | 2022-11-07 21:46:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 21:46:23 +0300 |
commit | 3020d6da64798ee994d407ffd3ce3f800f6dff92 (patch) | |
tree | 4ed3232c30221851cfaf5c074fdc36c6c5c8bcc1 /test/python | |
parent | 73a9c7d38293067a4081b8d79dd12e92a585ef83 (diff) |
Fix python feature issue #258, improve tests, fix oryx bug (#261)
* Fix #258, improve tests, fix oryx bug
* Drop Debian 9 from tests given it is out of support
Diffstat (limited to 'test/python')
-rwxr-xr-x[-rw-r--r--] | test/python/install_additional_jupyterlab.sh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | test/python/install_additional_python.sh | 33 | ||||
-rwxr-xr-x[-rw-r--r--] | test/python/install_jupyterlab.sh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | test/python/install_os_provided_python.sh | 23 | ||||
-rwxr-xr-x | test/python/install_via_oryx.sh | 37 | ||||
-rw-r--r-- | test/python/scenarios.json | 7 | ||||
-rwxr-xr-x | test/python/test.sh | 25 |
7 files changed, 118 insertions, 7 deletions
diff --git a/test/python/install_additional_jupyterlab.sh b/test/python/install_additional_jupyterlab.sh index d48bb46..d48bb46 100644..100755 --- a/test/python/install_additional_jupyterlab.sh +++ b/test/python/install_additional_jupyterlab.sh diff --git a/test/python/install_additional_python.sh b/test/python/install_additional_python.sh index 00e43d8..bbd6c13 100644..100755 --- a/test/python/install_additional_python.sh +++ b/test/python/install_additional_python.sh @@ -5,11 +5,34 @@ set -e # Optional: Import test library source dev-container-features-test-lib -check "python version 3.11 installed as default" python --version | grep 3.11 -check "python3 version 3.11 installed as default" python3 --version | grep 3.11 -check "python version 3.10.5 installed" ls -l /usr/local/python | grep 3.10.5 -check "python version 3.8.13 installed" ls -l /usr/local/python | grep 3.8.13 -check "python version 3.9.13 installed" ls -l /usr/local/python | grep 3.9.13 +check "python version 3.11 installed as default" bash -c "python --version | grep 3.11" +check "python3 version 3.11 installed as default" bash -c "python3 --version | grep 3.11" +check "python version 3.10.5 installed" bash -c "ls -l /usr/local/python | grep 3.10.5" +check "python version 3.8 installed" bash -c "ls -l /usr/local/python | grep 3.8" +check "python version 3.9.13 installed" bash -c "ls -l /usr/local/python | grep 3.9.13" + +# Check that tools can execute - make sure something didn't get messed up in this scenario +check "autopep8" autopep8 --version +check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version +check "flake8" flake8 --version +check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version +check "pylint" pylint --version + +# Check paths in settings +check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python" +check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" +check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" +check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" +check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" +check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result reportResults diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh index d48bb46..d48bb46 100644..100755 --- a/test/python/install_jupyterlab.sh +++ b/test/python/install_jupyterlab.sh diff --git a/test/python/install_os_provided_python.sh b/test/python/install_os_provided_python.sh index 50a617e..e65b154 100644..100755 --- a/test/python/install_os_provided_python.sh +++ b/test/python/install_os_provided_python.sh @@ -10,7 +10,28 @@ check "python is installed" python --version check "pip is installed" pip --version check "pip is installed" pip3 --version -check "node is installed" node --version +# Check that tools can execute +check "autopep8" autopep8 --version +check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version +check "flake8" flake8 --version +check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version +check "pylint" pylint --version + +# Check paths in settings +check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python" +check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" +check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" +check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" +check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" +check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result reportResults
\ No newline at end of file diff --git a/test/python/install_via_oryx.sh b/test/python/install_via_oryx.sh new file mode 100755 index 0000000..e65b154 --- /dev/null +++ b/test/python/install_via_oryx.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "python3 is installed" python3 --version +check "python is installed" python --version +check "pip is installed" pip --version +check "pip is installed" pip3 --version + +# Check that tools can execute +check "autopep8" autopep8 --version +check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version +check "flake8" flake8 --version +check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version +check "pylint" pylint --version + +# Check paths in settings +check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python" +check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" +check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" +check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" +check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" +check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" + +# Report result +reportResults
\ No newline at end of file diff --git a/test/python/scenarios.json b/test/python/scenarios.json index 80e0fb5..920f4a2 100644 --- a/test/python/scenarios.json +++ b/test/python/scenarios.json @@ -33,8 +33,13 @@ "install_os_provided_python": { "image": "mcr.microsoft.com/devcontainers/base:0-bullseye", "features": { - "node": "latest", "python": "os-provided" } + }, + "install_via_oryx": { + "image": "mcr.microsoft.com/oryx/build:full-debian-bullseye", + "features": { + "python": "3.10" + } } }
\ No newline at end of file diff --git a/test/python/test.sh b/test/python/test.sh index 7bd2281..8f7d336 100755 --- a/test/python/test.sh +++ b/test/python/test.sh @@ -7,6 +7,31 @@ source dev-container-features-test-lib # Definition specific tests check "version" python --version +check "pip is installed" pip --version +check "pip is installed" pip3 --version + +# Check that tools can execute +check "autopep8" autopep8 --version +check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version +check "flake8" flake8 --version +check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version +check "pylint" pylint --version + +# Check paths in settings +check "current symlink is correct" bash -c "which python | grep /usr/local/python/current/bin/python" +check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" +check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" +check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" +check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" +check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result reportResults |