Hi Fritz, > So in my class's public boolean perform(AbstractBuild build,Launcher >launcher, BuildListener listener) method I end with:
Try the following: public boolean perform(AbstractBuild build,Launcher launcher, BuildListener listener) { ... build.setResult(Result.UNSTABLE); ... } Hope that helps, Bruno P. Kinoshita http://kinoshita.eti.br http://tupilabs.com >________________________________ > From: Frits <fjalvi...@gmail.com> >To: Jenkins Developers <jenkinsci-dev@googlegroups.com> >Sent: Friday, 2 March 2012 6:00 PM >Subject: Questions on making a plugin > >Hi group, > >I am building a Jenkins plugin to compile Eclipse workspaces out-of- >the-box, without Maven. But I have some questions: > >* When JUnit tests fail in the build I want to mark the build as >unstable. So in my class's public boolean perform(AbstractBuild build, >Launcher launcher, BuildListener listener) method I end with: > > int utc = jtr.getFailedTestCount(); > if(utc > 0) { > listener.finished(Result.UNSTABLE); > listener.error(utc + " junit tests have failed"); > System.out.println("Return UNSTABLE: " + utc); > } > return true; > >However the job remains to be marked as SUCCESFUL as can be seen on >the console: > >Return UNSTABLE: 44 >Mar 2, 2012 9:40:27 PM hudson.model.Run run >INFO: test #54 main build action completed: SUCCESS > >How can I mark a build as unstable? I want my yellow balls... > >* An Eclipse workspace consists of different modules (projects) also, >just like Maven. I would like to present most information from an >Eclipse build in the same way as a Maven build, as a set of modules >that failed/tested/worked etc. But I seem to be unable to find generic >infrastructure for this- it looks like all of this is maven specific. >Is that true? (Then I can stop searching ;-) > >* Similarly I want to show the JUnit test results in the same way as >the Maven test results. Like the failure history on the job's page >("Test Result Trend") and the links to the individual module results. >Is code for that reusable in Jenkins and where could I find that? > >Hope someone can answer... > >Greetings, > >Frits Jalvingh > > >