This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor workunit failure into final exit code.
Previously if a workunit fails, the run will end with Pants printing `FAILURE`, but the exit code is 0. This change factors the result of workunit into the final exit code as well. Before: ```bash $ ./pants --pythonpath=tests/python --backend-packages=pants_test.goal.data do-some-work 23:41:53 00:00 [main] (To run a reporting server: ./pants server) 23:41:53 00:00 [setup] 23:41:53 00:00 [parse] Executing tasks in goals: bootstrap -> do-some-work 23:41:54 00:01 [bootstrap] 23:41:54 00:01 [substitute-aliased-targets] 23:41:54 00:01 [jar-dependency-management] 23:41:54 00:01 [bootstrap-jvm-tools] 23:41:54 00:01 [provide-tools-jar] 23:41:54 00:01 [do-some-work] 23:41:54 00:01 [do-some-work] 23:41:54 00:01 [non.existent.main.class] ==== stderr ==== java.lang.ClassNotFoundException: non.existent.main.class at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.martiansoftware.nailgun.NGSession.run(NGSession.java:242) ==== stdout ==== 23:41:54 00:01 [complete] FAILURE $ echo $? 0 ``` After: ```bash $ ./pants --pythonpath=tests/python --backend-packages=pants_test.goal.data do-some-work 23:41:53 00:00 [main] (To run a reporting server: ./pants server) 23:41:53 00:00 [setup] 23:41:53 00:00 [parse] Executing tasks in goals: bootstrap -> do-some-work 23:41:54 00:01 [bootstrap] 23:41:54 00:01 [substitute-aliased-targets] 23:41:54 00:01 [jar-dependency-management] 23:41:54 00:01 [bootstrap-jvm-tools] 23:41:54 00:01 [provide-tools-jar] 23:41:54 00:01 [do-some-work] 23:41:54 00:01 [do-some-work] 23:41:54 00:01 [non.existent.main.class] ==== stderr ==== java.lang.ClassNotFoundException: non.existent.main.class at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.martiansoftware.nailgun.NGSession.run(NGSession.java:242) ==== stdout ==== 23:41:54 00:01 [complete] FAILURE $ echo $? 1 ``` Testing Done: https://travis-ci.org/pantsbuild/pants/builds/161491405 Bugs closed: 3882 Reviewed at https://rbcommons.com/s/twitter/r/4244/
- Loading branch information