travis/gitlab/azure: Simplify the exit code for test.py
authorSimon Glass <sjg@chromium.org>
Wed, 18 Mar 2020 15:42:59 +0000 (09:42 -0600)
committerTom Rini <trini@konsulko.com>
Sat, 11 Apr 2020 01:33:09 +0000 (21:33 -0400)
It seems unnecessary to read the exit code and then check it again. Drop
this and just let the test.py provide the exit code directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
.azure-pipelines.yml
.gitlab-ci.yml
.travis.yml

index 219b79e7b33bdde91008dec8a51ac0e0197c4fda..48fb1b8e61d0287feefb0b7822c9feb985844b14 100644 (file)
@@ -278,10 +278,6 @@ jobs:
           export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
           # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
           ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
-          ret=$?;
-          if [[ $ret -ne 0 ]]; then
-              exit $ret;
-          fi
           # the below corresponds to .gitlab-ci.yml "after_script"
           rm -rf /tmp/uboot-test-hooks /tmp/venv
           EOF
index 59f7f0b8bc54d16d1b5898bd1a2d096b71ea593b..c64911207f1d3add9bc68d85df7d66505b530761 100644 (file)
@@ -54,11 +54,7 @@ stages:
       export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
       ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
         ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
-        --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
-      ret=$?;
-      if [[ $ret -ne 0 ]]; then
-        exit $ret;
-      fi
+        --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
 
 build all 32bit ARM platforms:
   tags: [ 'all' ]
index ba005f7d12b70e4d7e60d1306e32a1e39cc17477..176cf0c6f22b75660c3a4ea4aa1d921307b82d9c 100644 (file)
@@ -245,11 +245,7 @@ script:
      pip install -r test/py/requirements.txt;
      ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
        ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
-       --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
-     ret=$?;
-     if [[ $ret -ne 0 ]]; then
-       exit $ret;
-     fi;
+       --build-dir "$UBOOT_TRAVIS_BUILD_DIR" || exit;
      if [[ -n "${TEST_PY_TOOLS}" ]]; then
        export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
        export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";