It's all about the answers!

Ask a question

Build failed due to failed JUnit tests


Roman Smirak (3164933) | asked Apr 03 '08, 7:24 a.m.
Hi,

I have a unit tests specifying defect or functionality to be done in
next iteration; it is OK it fails at the time.

How to specify a build should succeed although the tests failed? I removed
errorProperty and failureProperty; the build still fails.

Regards,

Roman

6 answers



permanent link
Don Weinand (7851) | answered Apr 03 '08, 11:05 a.m.
JAZZ DEVELOPER
The junitLogPublisher task supports a "mayFailPattern" attribute. We move the test classes that may fail in a suite called AllTestsMayFail.java and then include the "AllTestsMayFail" as the pattern when the JUnit results are published for that suite. This will allow tests to fail in that suite and not affect the overall build status.

Don Weinand
Jazz Team Build

permanent link
Roman Smirak (3164933) | answered Apr 04 '08, 5:49 a.m.
Hi,

I have renamed the test suite class to: SmokeAllmayFailPattern.java and
the build.xml includes:
<junitLogPublisher
filePath="${dir.junit}/TEST-com.tietoenator.terup.agile.test.SmokeAllmayFailPattern.xml"
buildResultUUID="${buildResultUUID}"
repositoryAddress="${repositoryAddress}" userId="***" password="****"
mayFailPattern="true"/>

However, the build still fails.

Did I missed something?

Roman

"dmweinan" <dmweinan@us.ibm-dot-com.no-spam.invalid> wrote in message
news:ft2rse$3cv$1@localhost.localdomain...
The junitLogPublisher task supports a "mayFailPattern"
attribute. We move the test classes that may fail in a suite called
AllTestsMayFail.java and then include the "AllTestsMayFail"
as the pattern when the JUnit results are published for that suite.
This will allow tests to fail in that suite and not affect the
overall build status.

Don Weinand
Jazz Team Build

permanent link
Don Weinand (7851) | answered Apr 04 '08, 10:03 a.m.
JAZZ DEVELOPER
It seems like your may fail pattern should be "SmokeAllmayFailPattern".


Don Weinand
Jazz Team Build

permanent link
Roman Smirak (3164933) | answered Apr 07 '08, 4:00 a.m.
That is exactly what I have - see my previous post.

Or am I blind to see some simple difference?

Roman

"dmweinan" <dmweinan@us.ibm-dot-com.no-spam.invalid> wrote in message
news:ft5cnv$6ru$1@localhost.localdomain...
It seems like your may fail pattern should be
"SmokeAllmayFailPattern".


Don Weinand
Jazz Team Build

permanent link
Don Weinand (7851) | answered Apr 07 '08, 10:35 a.m.
JAZZ DEVELOPER
I see this in your post...

mayFailPattern="true"/>

It should contain the pattern that should be ignored. It's the test suite name that the pattern is being compared against not the name of the log file. The JUnitLogPublisherTask can support publishing an entire directory of log files so it will allow any test suite it finds that matches the pattern to fail. The Javadoc for this task that is located in \jazz\buildsystem\buildtoolkit\task-javadoc\index.html explains how this parameter as well as the others are expected to be used.

Don Weinand
Jazz Team Build

permanent link
Roman Smirak (3164933) | answered Apr 07 '08, 10:55 a.m.
I see now.

Thanks,

Roman

"dmweinan" <dmweinan@us.ibm-dot-com.no-spam.invalid> wrote in message
news:ftdbja$tom$1@localhost.localdomain...
I see this in your post...

mayFailPattern="true"/

It should contain the pattern that should be ignored. It's the test
suite name that the pattern is being compared against not the name of
the log file. The JUnitLogPublisherTask can support publishing an
entire directory of log files so it will allow any test suite it
finds that matches the pattern to fail. The Javadoc for this task
that is located in
\jazz\buildsystem\buildtoolkit\task-javadoc\index.html explains how
this parameter as well as the others are expected to be used.

Don Weinand
Jazz Team Build

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.