Ensure pipeline failuires fail CI.

Review Request #2731 - Created Aug. 31, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/2053
2053, 2096
c703fe2...
Reviewers
pants-reviews
patricklaw, stuhood, zundel
We use pipelines to collect filtered lists of targets for
several CI steps.  Previously these could fail when BUILD
files had sytax or other errors, but the CI run would proceed
with no targets.  This change turns on pipefail and lifts up
target collection steps so they are AND'ed with the steps
that use them such that pipefail actually triggers an overall
failure in those steps.

 build-support/bin/ci.sh | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

Manually tested by introducing 2 BUILD file errors:

$ git diff -U1 pants-plugins/
diff --git a/pants-plugins/tests/python/internal_backend_test/BUILD b/pants-plugins/tests/python/internal_backend_test/BUILD
index b9577ff..7b0e067 100644
--- a/pants-plugins/tests/python/internal_backend_test/BUILD
+++ b/pants-plugins/tests/python/internal_backend_test/BUILD
@@ -3,3 +3,3 @@

-target(
+target2(
   name='all',

$ git diff -U1 -- tests/python/
diff --git a/tests/python/pants_test/BUILD b/tests/python/pants_test/BUILD
index 3a3cc05..a710ed0 100644
--- a/tests/python/pants_test/BUILD
+++ b/tests/python/pants_test/BUILD
@@ -3,2 +3,4 @@

+GARBAGE
+
 python_library(

Then tested each pipeline-using CI step.

Internal plugins:

$ ./build-support/bin/ci.sh -fkmsrjpnca
...
Exception message: name 'target2' is not defined
 while executing BUILD file FilesystemBuildFile(/home/jsirois/dev/3rdparty/jsirois-pants/pants-plugins/tests/python/internal_backend_test/BUILD)
 Loading addresses from 'pants-plugins/tests/python/internal_backend_test' failed.
Invalid BUILD files for [pants-plugins/tests/python::]

INFO] Detected git repository at /home/jsirois/dev/3rdparty/jsirois-pants on branch jsirois/issues/2053

Internal backend python test failure

Python unit tests:

$ ./build-support/bin/ci.sh -fkmsrjlnca
...
Exception message: name 'GARBAGE' is not defined
 while executing BUILD file FilesystemBuildFile(/home/jsirois/dev/3rdparty/jsirois-pants/tests/python/pants_test/BUILD)
 Loading addresses from 'tests/python/pants_test' failed.
Invalid BUILD files for [tests/python::]

INFO] Detected git repository at /home/jsirois/dev/3rdparty/jsirois-pants on branch jsirois/issues/2053

Core python test failure

Python integration tests:

$ ./build-support/bin/ci.sh -fkmsrjlpna
...
Exception message: name 'GARBAGE' is not defined
 while executing BUILD file FilesystemBuildFile(/home/jsirois/dev/3rdparty/jsirois-pants/tests/python/pants_test/BUILD)
 Loading addresses from 'tests/python/pants_test' failed.
Invalid BUILD files for [tests/python::]

INFO] Detected git repository at /home/jsirois/dev/3rdparty/jsirois-pants on branch jsirois/issues/2053

Pants Integration test failure

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/77969386

John Sirois
Stu Hood
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...