It's all about the answers!

Ask a question

Can the build status be changed manually?


Jon Norman (1633) | asked Mar 09 '12, 10:00 a.m.
I have been running some builds with JUnit tests and am using a JUnit publisher to publish the results to the build. However I don't want the build to be classed as failed if a single unit test fails.

Is there a way for me to manually edit the build status or at least prevent the jUnitLogPublisher from setting the build to failed if a failure occurs?

2 answers



permanent link
David Lafreniere (4.8k7) | answered Mar 09 '12, 10:35 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
However I don't want the build to be classed as failed if a single unit test fails.


You could use the 'mayFailPattern' of the junitLogPublisher

See this link for a reference: http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.build.doc/topics/r_junitlogpublisher.html

mayFailPattern

A substring of a test suite class name. Any test suite class name that contains the pattern is allowed to fail without causing the overall build to fail. The pattern is a simple string, not a regular expression. If not specified, any test suite failure causes the build to fail.


Is there a way for me to manually edit the build status?


If you are controlling the build lifecycle on your own (using Ant).. you could use the "status" attribute of the "completeTeamBuild" Ant task.

See this link for a reference: http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.build.doc/topics/r_completebuild.html

status

The status of the contribution. Must be one of the following: OK, ERROR, WARNING, or INFO.

permanent link
Jon Norman (1633) | answered Mar 12 '12, 6:03 a.m.
Thank you for your response. As far as I understand it the completeTeamBuild attribute is quite final, and I think that calling this task in the middle of the build cycle could mess up the whole process a bit.

However I don't want the build to be classed as failed if a single unit test fails.


You could use the 'mayFailPattern' of the junitLogPublisher

See this link for a reference: http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.build.doc/topics/r_junitlogpublisher.html

mayFailPattern

A substring of a test suite class name. Any test suite class name that contains the pattern is allowed to fail without causing the overall build to fail. The pattern is a simple string, not a regular expression. If not specified, any test suite failure causes the build to fail.


Is there a way for me to manually edit the build status?


If you are controlling the build lifecycle on your own (using Ant).. you could use the "status" attribute of the "completeTeamBuild" Ant task.

See this link for a reference: http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.build.doc/topics/r_completebuild.html

status

The status of the contribution. Must be one of the following: OK, ERROR, WARNING, or INFO.

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.