Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Build failed due to failed JUnit tests

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

0 votes



6 answers

Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
It seems like your may fail pattern should be "SmokeAllmayFailPattern".


Don Weinand
Jazz Team Build

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Apr 03 '08, 7:24 a.m.

Question was seen: 8,962 times

Last updated: Apr 03 '08, 7:24 a.m.

Confirmation Cancel Confirm