Hi Frits,
As for JUnit results, look at hudson.tasks.junit.JUnitResultArchiver class.
It uses JUnitParser to parse provided xml's and adds TestResultAction to
the build.
TestResultAction extends hudson.tasks.test.AbstractTestResultAction
which provides links to results, charts, etc.
But may be you would like to use the existing *'Publish JUnit results' *at
the job configuration?
In this case, you only need to find out where generated JUnit reports are
stored and put their
paths to a job configuration.
Victor.
суббота, 3 марта 2012 г. 1:00:36 UTC+4 пользователь Frits написал:
>
> 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
>