3

I have a job which runs successfully as a maven build, but fails when run in Hudson.

The regular output shows BUILD SUCCESSFUL but the build is marked as failed (red ball) and Cobertura reporting is skipped "because build was not UNSTABLE or better".

I tried putting a log recorder on hudson.model.Run, which shows that some process is setting the build status to failed (one to failed, then one to successful, then a second one setting it back to failed). However, this doesn't give me any insight into which process this is, or why it is doing that.

What can I do to troubleshoot the reason for and origin of this failure?

EDIT: The last few lines of my console output show the regular maven BUILD SUCCESS info messages, followed by:

channel stopped
Skipping Cobertura coverage report as build was not Unstable or better
Finished: SUCCESS
CPhelps
  • 279
  • 1
  • 3
  • 7
  • I have no input on how to troubleshoot that, but I'd check if I don't have a questionable unit test somewhere which could confuse Cobertura (test class with no test or something of that nature). – ptyx Dec 15 '11 at 23:15
  • How about the console output? The last few lines should give some info – Raghuram Dec 16 '11 at 08:47
  • I edited the question with my last few lines of console output. As far as this shows, everything worked fine. Apparently either maven itself is marking the build failed AFTER reporting the success, or something is happening before Cobertura plugin attempts to build its report. – CPhelps Dec 16 '11 at 12:39

1 Answers1

1

The failure of a build in hudson is determined by the last build step returning successfully (RC 0). Do you build this as a freestyle or maven project in hudson? If it is freestyle, is it the only process run?

Build failures in hudson can also come from failing post build steps such as collecting test result information, etc

Steven
  • 3,844
  • 3
  • 32
  • 53
  • This is run as a maven project. I think it is likely that it is coming from a post build step - most likely generating the cobertura reporting from the cobertura xml generated during the build proper. The question is, how to narrow down who/where/why this failure is occurring. – CPhelps Dec 16 '11 at 12:12
  • If you take cobertura out does it pass the build? Try cutting out build steps and take the phase down to "test". – Steven Dec 16 '11 at 13:10