aboutsummaryrefslogtreecommitdiff
path: root/test/oryx/test_python_project.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/oryx/test_python_project.sh')
-rw-r--r--test/oryx/test_python_project.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/oryx/test_python_project.sh b/test/oryx/test_python_project.sh
new file mode 100644
index 0000000..a0d5eef
--- /dev/null
+++ b/test/oryx/test_python_project.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+cd sample-python
+
+# Replicates Oryx's behavior for universal image
+DEBIAN_FLAVOR="focal-scm"
+mkdir -p /opt/oryx && echo "vso-focal" > /opt/oryx/.imagetype
+echo "DEBIAN|${DEBIAN_FLAVOR}" | tr '[a-z]' '[A-Z]' > /opt/oryx/.ostype
+
+ln -snf /usr/local/oryx/* /opt/oryx
+
+PYTHON_PATH="/home/codespace/.python/current"
+mkdir -p /home/codespace/.python
+ln -snf /usr/local/python/current $PYTHON_PATH
+ln -snf /usr/local/python /opt/python
+
+export PATH="/home/codespace/.python/current/bin:${PATH}"
+which python
+
+pythonVersion=$(python -V 2>&1 | grep -Po '(?<=Python )(.+)')
+pythonSite=`python -m site --user-site`
+check "oryx-build-python" oryx build --property python_version="${pythonVersion}" --property packagedir="${pythonSite}" ./
+check "oryx-build-python-installed" python3 -m pip list | grep mpmath
+check "oryx-build-python-result" python3 ./src/solve.py
+
+# Report result
+reportResults