From 2fedda0828d1b89406c60b18e6a0c5489f1b3a8a Mon Sep 17 00:00:00 2001 From: Tim Head Date: Sat, 15 Sep 2018 08:51:30 +0200 Subject: [PATCH] Update postBuild+start test case This test was missing a start script, added it. Updated the README to explain what the test case was doing. --- tests/venv/start/postBuild/README.rst | 13 +++++-------- tests/venv/start/postBuild/postBuild | 4 ++++ tests/venv/start/postBuild/start | 4 ++++ tests/venv/start/postBuild/verify | 3 ++- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 tests/venv/start/postBuild/start diff --git a/tests/venv/start/postBuild/README.rst b/tests/venv/start/postBuild/README.rst index 1a9851f3..ecfd428e 100644 --- a/tests/venv/start/postBuild/README.rst +++ b/tests/venv/start/postBuild/README.rst @@ -1,8 +1,5 @@ -System - Post-build scripts ---------------------------- - -It is possible to run scripts after you've built the environment specified in -your other files. This could be used to, for example, download data or run -some configuration scripts. - -In this example, we download and install a Jupyter Notebook extension. +postBuild and start +------------------- + +This test checks that we can use a postBuild and start script +at the same time. diff --git a/tests/venv/start/postBuild/postBuild b/tests/venv/start/postBuild/postBuild index 28b840f0..dbf15529 100755 --- a/tests/venv/start/postBuild/postBuild +++ b/tests/venv/start/postBuild/postBuild @@ -1,2 +1,6 @@ #!/bin/bash + +# this value should not be visible in `verify` +export TEST_START_VAR="var is set by postBuild" + jupyter nbextension enable --py --sys-prefix ipyleaflet diff --git a/tests/venv/start/postBuild/start b/tests/venv/start/postBuild/start new file mode 100644 index 00000000..b8354e90 --- /dev/null +++ b/tests/venv/start/postBuild/start @@ -0,0 +1,4 @@ +#!/bin/bash + +export TEST_START_VAR="var is set" +exec "$@" diff --git a/tests/venv/start/postBuild/verify b/tests/venv/start/postBuild/verify index cc0d9ea7..2daa9539 100755 --- a/tests/venv/start/postBuild/verify +++ b/tests/venv/start/postBuild/verify @@ -2,7 +2,8 @@ set -euo pipefail jupyter nbextension list | grep 'jupyter-leaflet' | grep enabled -if [ "$TEST_START_VAR" != "var is set" ] +# set value of TEST_START_VAR to empty string when it is not defined +if [ "${TEST_START_VAR:-}" != "var is set" ] then echo "TEST_START_VAR is not set" exit 1