lein-teamcity icon indicating copy to clipboard operation
lein-teamcity copied to clipboard

Completes with success on build failure

Open sarudak opened this issue 11 years ago • 7 comments

It works great for dealing with test failures but if the reader has a problem with one of the files and errors out the build is still marked as successful.

sarudak avatar Apr 22 '14 20:04 sarudak

Do you mean some of the files has a syntactic errors? Can you provide an example so I can reproduce the problem?

nd avatar Apr 22 '14 20:04 nd

It tries to test. Fails to read the file (due to some errant parens I added) and then exits but with a success code of 0 leading teamcity to believe the build succeeded.

[10:56:14]: [do] clean [10:56:14]: [do] test (8s) [10:56:14]: [test] javac [10:56:14]: [test] compile [10:56:22]: [test] Exception in thread "main" java.lang.RuntimeException: EOF while reading, starting at line 18, compiling:(imat_clj/test/handler.clj:19:1) [10:56:22]: [test] at clojure.lang.Compiler.load(Compiler.java:7071) [10:56:22]: [test] at clojure.lang.RT.loadResourceScript(RT.java:370) [10:56:22]: [test] at clojure.lang.RT.loadResourceScript(RT.java:361) [10:56:22]: [test] at clojure.lang.RT.load(RT.java:440) [10:56:22]: [test] at clojure.lang.RT.load(RT.java:411) [10:56:22]: [test] at clojure.core$load$fn__5018.invoke(core.clj:5530) [10:56:22]: [test] at clojure.core$load.doInvoke(core.clj:5529) [10:56:22]: [test] at clojure.lang.RestFn.invoke(RestFn.java:408) [10:56:22]: [test] at clojure.core$load_one.invoke(core.clj:5336) [10:56:22]: [test] at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) [10:56:22]: [test] at clojure.core$load_lib.doInvoke(core.clj:5374) [10:56:22]: [test] at clojure.lang.RestFn.applyTo(RestFn.java:142) [10:56:22]: [test] at clojure.core$apply.invoke(core.clj:619) [10:56:22]: [test] at clojure.core$load_libs.doInvoke(core.clj:5413) [10:56:22]: [test] at clojure.lang.RestFn.applyTo(RestFn.java:137) [10:56:22]: [test] at clojure.core$apply.invoke(core.clj:619) [10:56:22]: [test] at clojure.core$require.doInvoke(core.clj:5496) [10:56:22]: [test] at clojure.lang.RestFn.applyTo(RestFn.java:137) [10:56:22]: [test] at clojure.core$apply.invoke(core.clj:619) [10:56:22]: [test] at user$eval85.invoke(form-init2697712666719265980.clj:1) [10:56:22]: [test] at clojure.lang.Compiler.eval(Compiler.java:6619) [10:56:22]: [test] at clojure.lang.Compiler.eval(Compiler.java:6609) [10:56:22]: [test] at clojure.lang.Compiler.load(Compiler.java:7064) [10:56:22]: [test] at clojure.lang.Compiler.loadFile(Compiler.java:7020) [10:56:22]: [test] at clojure.main$load_script.invoke(main.clj:294) [10:56:22]: [test] at clojure.main$init_opt.invoke(main.clj:299) [10:56:22]: [test] at clojure.main$initialize.invoke(main.clj:327) [10:56:22]: [test] at clojure.main$null_opt.invoke(main.clj:362) [10:56:22]: [test] at clojure.main$main.doInvoke(main.clj:440) [10:56:22]: [test] at clojure.lang.RestFn.invoke(RestFn.java:421) [10:56:22]: [test] at clojure.lang.Var.invoke(Var.java:419) [10:56:22]: [test] at clojure.lang.AFn.applyToHelper(AFn.java:163) [10:56:22]: [test] at clojure.lang.Var.applyTo(Var.java:532) [10:56:22]: [test] at clojure.main.main(main.java:37) [10:56:22]: [test] Caused by: java.lang.RuntimeException: EOF while reading, starting at line 18 [10:56:22]: [test] at clojure.lang.Util.runtimeException(Util.java:219) [10:56:22]: [test] at clojure.lang.LispReader.readDelimitedList(LispReader.java:1139) [10:56:22]: [test] at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982) [10:56:22]: [test] at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148) [10:56:22]: [test] at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982) [10:56:22]: [test] at clojure.lang.LispReader.readDelimitedList(LispReader.java:1148) [10:56:22]: [test] at clojure.lang.LispReader$ListReader.invoke(LispReader.java:982) [10:56:22]: [test] at clojure.lang.LispReader.read(LispReader.java:185) [10:56:22]: [test] at clojure.lang.Compiler.load(Compiler.java:7060) [10:56:22]: [test] ... 33 more [10:56:22]: [test] Tests failed. [10:56:22]: [test] Error encountered performing task 'do' with profile(s): 'default,teamcity' [10:56:22]: [test] Suppressed exit [10:56:22]: [test] Process exited with code 0

sarudak avatar Apr 22 '14 20:04 sarudak

Hmm, in my case process exits with exit code 1 and a build is marked as failed. I've tested it with lein 2.3.4. How do you run leiningen in the build step?

nd avatar May 01 '14 22:05 nd

I use the step from the instructions.

C:\Lein\lein.bat with-profile +teamcity do clean, test, jar

The profile is currently included with the project as opposed to on the box itself.

I'm using a simple command line runner step.

On Thu, May 1, 2014 at 3:01 PM, nd [email protected] wrote:

Hmm, in my case process exits with exit code 1 and a build is marked as failed. How do you run leiningen in the build step?

— Reply to this email directly or view it on GitHubhttps://github.com/nd/lein-teamcity/issues/1#issuecomment-41962117 .

sarudak avatar May 02 '14 20:05 sarudak

What leiningen version do you use?

nd avatar May 02 '14 20:05 nd

PS H:> lein -v Leiningen 2.3.4 on Java 1.7.0_55 Java HotSpot(TM) Client VM

On Fri, May 2, 2014 at 1:21 PM, nd [email protected] wrote:

What leiningen version do you use?

— Reply to this email directly or view it on GitHubhttps://github.com/nd/lein-teamcity/issues/1#issuecomment-42074976 .

sarudak avatar May 02 '14 20:05 sarudak

Sorry for late reply. I still wasn't able to reproduce the problem. I've created a lein-teamcity 0.2.2 with a fix to the second issue, please give it a try.

nd avatar Jun 16 '14 21:06 nd