From 7bc05ec83ac32cb3fe91a5c4f894799b8f74629a Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Thu, 21 May 2020 16:01:19 -0700 Subject: [PATCH] [CI] Allow CI_PYTEST_ADD_OPTIONS to be unbound. (#5644) This patch allows the test script to execute normally when CI_PYTEST_ADD_OPTIONS is not available. --- tests/scripts/setup-pytest-env.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/scripts/setup-pytest-env.sh b/tests/scripts/setup-pytest-env.sh index 36d095692ec8..a281de003031 100755 --- a/tests/scripts/setup-pytest-env.sh +++ b/tests/scripts/setup-pytest-env.sh @@ -16,8 +16,14 @@ # specific language governing permissions and limitations # under the License. +# NOTE: allow unbound variable here +set +u +if [[ ! -z $CI_PYTEST_ADD_OPTIONS ]]; then + export PYTEST_ADDOPTS="-v $CI_PYTEST_ADD_OPTIONS" +else + export PYTEST_ADDOPTS="" +fi set -u -set -e + export TVM_PATH=`pwd` export PYTHONPATH=${TVM_PATH}/python:${TVM_PATH}/topi/python -export PYTEST_ADDOPTS="-v $CI_PYTEST_ADD_OPTIONS"