Skip to contentSkip to conversation

travis: Correct error checking when building boards

PATCH New Simon Glass 3 participants 3 messages Apr 19, 2020 – Apr 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 travis: Correct error checking when building boards

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.

---

Changes in v2:
- Fix missing ret=0

 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +2 -1
index b3253da13c..1dbc63cadf 100644
@@ -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;
Signature · 1 line
2.26.1.301.g55bc3eb7cb9-goog
#1 lore raw

PATCH v2 1/1 travis: Correct error checking when building boards

Quoted 24 lines · Simon Glass

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.

---

Changes in v2:
- Fix missing ret=0

 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +0 -0
index b3253da13c..1dbc63cadf 100644

.travis.yml script: · line 215

Quoted 9 lines
.travis.yml +2 -1
@@ -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;

Thanks,
Michal

#2 lore raw

PATCH v2 1/1 travis: Correct error checking when building boards

In reply to Simon Glass
Quoted 11 lines · Simon Glass

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/22a044a2/attachment.sig>