summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-03-18 09:42:56 -0600
committerTom Rini <trini@konsulko.com>2020-04-10 21:32:53 -0400
commit4080d0970d2cfe04562cc84afb47c5b33811700e (patch)
tree3b771a89ba44b3e6ca7020cd60ee64e04270c8a6 /.gitlab-ci.yml
parent4e32fed4d3e068d6dc859c2aec86b8487646e805 (diff)
travis/gitlab/azure: Use bash to avoid a_test_which_does_not_exist
Bash allows for variables to expand only if non-empty: $ var=test $ echo ${var:+"$var"} test $ echo ${var:+"-k $var"} -k test $ var= $ echo ${var:+"-k $var"} Use this feature to avoid the workaround. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml7
1 files changed, 2 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e77db777d..bf207db09e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,17 +47,14 @@ stages:
--board ${TEST_PY_BD};
exit $ret;
fi
- # "not a_test_which_does_not_exist" is a dummy -k parameter which will
- # never prevent any test from running. That way, we can always pass
- # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
- # value.
- virtualenv -p /usr/bin/python3 /tmp/venv
- . /tmp/venv/bin/activate
- pip install -r test/py/requirements.txt
+ # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
- export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
- -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
+ ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
--build-dir "$UBOOT_TRAVIS_BUILD_DIR";
ret=$?;
if [[ $ret -ne 0 ]]; then