diff mbox series

[v3,16/23] gitlab/azure: Drop unnecessary if..fi when using test.py

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

Commit Message

Simon Glass March 18, 2020, 3:42 p.m. UTC
Since TEST_PY_BD is always defined we can drop this check.

This does not affect travis since it has a single, unified script.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

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

 .azure-pipelines.yml | 22 +++++++++-------------
 .gitlab-ci.yml       | 30 +++++++++++++-----------------
 2 files changed, 22 insertions(+), 30 deletions(-)

Comments

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

> Since TEST_PY_BD is always defined we can drop this check.
> 
> This does not affect travis since it has a single, unified script.
> 
> 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 684359b88b..96f279853e 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -245,13 +245,11 @@  jobs:
           cp /opt/grub/grubarm.efi ~/grub_arm.efi
           # the below corresponds to .gitlab-ci.yml "script"
           cd ${WORK_DIR}
-          if [[ "${TEST_PY_BD}" != "" ]]; then
-              ret=0;
-              tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
-              if [[ $ret -ne 0 && $ret -ne 129 ]]; then
-                  tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
-                  exit $ret;
-              fi;
+          ret=0;
+          tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
+          if [[ $ret -ne 0 && $ret -ne 129 ]]; then
+              tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
+              exit $ret;
           fi
           virtualenv -p /usr/bin/python3 /tmp/venv
           . /tmp/venv/bin/activate
@@ -259,12 +257,10 @@  jobs:
           export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
           export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
           export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
-          if [[ "${TEST_PY_BD}" != "" ]]; then
-              ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
-              ret=$?;
-              if [[ $ret -ne 0 ]]; then
-                  exit $ret;
-              fi;
+          ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" --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
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 36c2ecfa43..b29d59d942 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,14 +29,12 @@  stages:
   script:
     # From buildman, exit code 129 means warnings only.  If we've been asked to
     # use clang only do one configuration.
-    - if [[ "${TEST_PY_BD}" != "" ]]; then
-        ret=0;
-        tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE}
-          || ret=$?;
-        if [[ $ret -ne 0 && $ret -ne 129 ]]; then
-          tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
-          exit $ret;
-        fi;
+    - ret=0;
+      tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE}
+        || ret=$?;
+      if [[ $ret -ne 0 && $ret -ne 129 ]]; then
+        tools/buildman/buildman -o /tmp -seP --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
@@ -48,15 +46,13 @@  stages:
     - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
       export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
       export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
-      if [[ "${TEST_PY_BD}" != "" ]]; then
-        ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
-          -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
-          --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
-        ret=$?;
-        if [[ $ret -ne 0 ]]; then
-          exit $ret;
-        fi;
-      fi;
+      ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
+        -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
+        --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
+      ret=$?;
+      if [[ $ret -ne 0 ]]; then
+        exit $ret;
+      fi
 
 build all 32bit ARM platforms:
   tags: [ 'all' ]