diff mbox series

[v2] travis: Correct error checking when building boards

Message ID 20200419230232.189273-1-sjg@chromium.org
State Accepted
Commit 08140dba0f539842d4836afb56fe43a33d8ba045
Headers show
Series [v2] travis: Correct error checking when building boards | expand

Commit Message

Simon Glass April 19, 2020, 11:02 p.m. UTC
At present if buildman reports an error, the travis build still succeeds.

This is because the travis script does not stop when it sees errors; nor
does it automatically return the exit code. Also the current error
checking never triggers since 'ret' is not set.

Fix this by setting 'ret' correctly.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reported-by: Michal Simek <michal.simek at xilinx.com>
---

Changes in v2:
- Fix missing ret=0

 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michal Simek April 20, 2020, 5:38 a.m. UTC | #1
On 20. 04. 20 1:02, Simon Glass wrote:
> At present if buildman reports an error, the travis build still succeeds.
> 
> This is because the travis script does not stop when it sees errors; nor
> does it automatically return the exit code. Also the current error
> checking never triggers since 'ret' is not set.
> 
> Fix this by setting 'ret' correctly.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reported-by: Michal Simek <michal.simek at xilinx.com>
> ---
> 
> Changes in v2:
> - Fix missing ret=0
> 
>  .travis.yml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index b3253da13c..1dbc63cadf 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -208,7 +208,8 @@ script:
>   #
>   # Build a selection of boards if TEST_PY_BD is empty
>   - if [[ "${BUILDMAN}" != "" ]]; then
> -     tools/buildman/buildman -P -E -W ${BUILDMAN} ${OVERRIDE};
> +     ret=0
> +     tools/buildman/buildman -P -E -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
>       if [[ $ret -ne 0 ]]; then
>         tools/buildman/buildman -seP ${BUILDMAN};
>         exit $ret;
> 

Acked-by: Michal Simek <michal.simek at xilinx.com>

Thanks,
Michal
Tom Rini April 24, 2020, 5:13 p.m. UTC | #2
On Sun, Apr 19, 2020 at 05:02:32PM -0600, Simon Glass wrote:

> At present if buildman reports an error, the travis build still succeeds.
> 
> This is because the travis script does not stop when it sees errors; nor
> does it automatically return the exit code. Also the current error
> checking never triggers since 'ret' is not set.
> 
> Fix this by setting 'ret' correctly.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reported-by: Michal Simek <michal.simek at xilinx.com>
> Acked-by: Michal Simek <michal.simek at xilinx.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index b3253da13c..1dbc63cadf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -208,7 +208,8 @@  script:
  #
  # Build a selection of boards if TEST_PY_BD is empty
  - if [[ "${BUILDMAN}" != "" ]]; then
-     tools/buildman/buildman -P -E -W ${BUILDMAN} ${OVERRIDE};
+     ret=0
+     tools/buildman/buildman -P -E -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
      if [[ $ret -ne 0 ]]; then
        tools/buildman/buildman -seP ${BUILDMAN};
        exit $ret;