In that case, the JUnit equivalent of failOnError could still help to
continue the build. The other part could be trickier.

My idea was to check for test failures for one of your subprojects at the
end of your build (or the end of your CI task). For TestNG, you could check
for the existence of testng-failed.xml. Maybe with JUnit there's something
similar? Then, when you discover test failures, you could fail the build.
I'm not sure what's the best way to do that, though - throwing an exception
would certainly work :)

On Sun, Oct 4, 2009 at 7:31 PM, Russel Winder
<[email protected]>wrote:

> On Sun, 2009-10-04 at 18:53 +0200, Levi Hoogenberg wrote:
> > So, if I understand you correctly, if one of the subprojects' tests
> > fail, you would like the build to continue, but still like it to fail
> > in the end?
> >
> Yes.
>
> The requirement here is to be able to run all the tests for all the
> projects in a CI system.  So, as you sat, a project's test fail
> shouldn't stop the other projects tests running but the final return
> code needs to be failure.
>
> > On Sun, Oct 4, 2009 at 2:29 PM, Russel Winder
> > <[email protected]> wrote:
> >         Levi,
> >
> >         On Sun, 2009-10-04 at 13:25 +0200, Levi Hoogenberg wrote:
> >         > Hi Russel,
> >         >
> >         > which test framework are you using? With TestNG you van use
> >         the
> >         > failOnError property; JUnit probably has something similar,
> >         but I
> >         > haven't used it for years.
> >         >
> >         >    Levi
> >
> >
> >         In this case I am using GroovyTestCases so JUnit under the
> >         covers.
> >         Whilst I prefer TestNG when using a framework directly, Groovy
> >         favours
> >         JUnit.
> >
> >         Though I am not sure failOnError is an issue here.  The tests
> >         for a
> >         given project are failing and Gradle is deciding to terminate
> >         the
> >         multi-project build on the first test fail.  I suspect what I
> >         need is a
> >         way of telling Gradle to ignore unit test fails.
> >
> >         Or maybe I am just misunderstanding the relationship Gradle
> >         sets up with
> >         the unit test runner -- which is entirely possible :-)
> >
> >
> >         --
> >         Russel.
> >
> =============================================================================
> >         Dr Russel Winder      Partner
> >                                                    xmpp:
> >         [email protected]
> >         Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
> >         41 Buckmaster Road,   f: +44 8700 516 084   voip:
> >         sip:[email protected] <sip%[email protected]>
> >         London SW11 1EN, UK   m: +44 7770 465 077   skype:
> >         russel_winder
> >
> >
> --
> Russel.
>
> =============================================================================
> Dr Russel Winder      Partner
>                                            xmpp: [email protected]
> Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
> 41 Buckmaster Road,   f: +44 8700 516 084   voip:
> sip:[email protected] <sip%[email protected]>
> London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder
>

Reply via email to