[CI] Allow CI_PYTEST_ADD_OPTIONS to be unbound. (#5644)
authorTianqi Chen <tqchen@users.noreply.github.com>
Thu, 21 May 2020 23:01:19 +0000 (16:01 -0700)
committerGitHub <noreply@github.com>
Thu, 21 May 2020 23:01:19 +0000 (16:01 -0700)
This patch allows the test script to execute normally
when CI_PYTEST_ADD_OPTIONS is not available.

tests/scripts/setup-pytest-env.sh

index 36d0956..a281de0 100755 (executable)
 # 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"