Skip to contentSkip to conversation

travis: Correct error checking when building boards

PATCH Superseded Simon Glass 2 participants 3 messages Apr 16, 2020 – Apr 19, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml +1 -1
index b3253da13c3..e5b2b5e335e 100644
@@ -208,7 +208,7 @@ script:
  #
  # Build a selection of boards if TEST_PY_BD is empty
  - if [[ "${BUILDMAN}" != "" ]]; then
-     tools/buildman/buildman -P -E -W ${BUILDMAN} ${OVERRIDE};
+     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.0.110.g2183baf09c-goog
#1 lore raw

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

Quoted 20 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.

---

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml +0 -0
index b3253da13c3..e5b2b5e335e 100644

.travis.yml script: · line 214

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

I am also missing ret=0; assignment which is also needed.

Please also add

to v2.

Thanks,
Michal

#2 lore raw

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

Hi Michal,

Quoted 16 lines · Michal Simek
Quoted 14 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.

---

 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
.travis.yml +0 -0
index b3253da13c3..e5b2b5e335e 100644

.travis.yml script: · line 214

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

I am also missing ret=0; assignment which is also needed.

Are you sure this is needed? It seems to work without it. By default variables are empty in bash.

But I will change it, since it is confusing otherwise.

Quoted 4 lines

Please also add

to v2.

OK will do.

- Simon