Hudson-CI shows a build as broken despite if the build was successful and only the unit tests are failing.
Could I configure it to show the red circle only on reall开发者_开发知识库y broken builds, and show another color (let's say yellow) when the build is successful and only other condition is broken?
Hudson will report the build as failing if the exit/error code on the last step is non-zero. Our testing tool (NUnit) returns a zero only if all the tests passed, and I suspect your tests are doing similar.
To get round this, configure Hudson to have two build steps per job. The first step builds the code. If this step fails, the build fails and appears as a RED circle.
The second step runs the tests - but is set to always return a zero exit code. e.g. I have a Execute Windows batch command step with the following command:
NUnit-console.exe /options as required...
exit 0
The exit 0
forces Hudson to think that the tests have run OK. Thus if both steps are run, the job will be labelled as sucessful.
Finally, if you use the "Publish NUnit test result report" option, Hudson can inspect the test results and make the build either unstable (YELLOW) if some tests failed or successful (GREEN) if all passed.
(There are other options for JUNit, MSTest etc. but I've only got experience with NUnit and Hudson)
failonerrors="on" on task tag. Isn't it you're looking for ? Apache Ant - task
精彩评论