diff mbox series

[v3,21/23] travis/gitlab/azure: Simplify the exit code for test.py

Message ID 20200318154302.16389-18-sjg@chromium.org
State Accepted
Commit cec1e856d3d40544fdf8d4d71e4805963c537c18
Headers show
Series gitlab: Simplify the test script | expand

Commit Message

Simon Glass March 18, 2020, 3:42 p.m. UTC
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 at chromium.org>
---

Changes in v3: None
Changes in v2:
- Update travis, azure also

 .azure-pipelines.yml | 4 ----
 .gitlab-ci.yml       | 6 +-----
 .travis.yml          | 6 +-----
 3 files changed, 2 insertions(+), 14 deletions(-)

Comments

Tom Rini March 23, 2020, 1:14 p.m. UTC | #1
On Wed, Mar 18, 2020 at 09:42:59AM -0600, Simon Glass wrote:

> 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 at chromium.org>

Reviewed-by: Tom Rini <trini at konsulko.com>
diff mbox series

Patch

diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 612e645d0a..28a6583319 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -259,10 +259,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
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 065ac769f9..64d8b1bdfc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -45,11 +45,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' ]
diff --git a/.travis.yml b/.travis.yml
index 5be4c54403..757e425467 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -147,11 +147,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}";