How to FInish Job Success even if it failed

77 views
Skip to first unread message

Gyanendra Mishra

unread,
Feb 26, 2014, 10:28:49 AM2/26/14
to jenkins...@googlegroups.com
Hi There
i am stuck at a point and need help
i am executing webdriver scripts using jenkins
if any test fails, build is failed
and then i am using post build action to rerun the failed scripts
my problem is that if post build task is successful but i see the overall job status as failed
is there any way to mark job as success if post build task is successful
i tried to add other post build task and text-finder plugin but no luck
using ant target in batch script

KT Kirk

unread,
Feb 26, 2014, 3:31:02 PM2/26/14
to jenkins...@googlegroups.com

Add a /bin/true on failed statement.


Try:

false || true

or

make test || true

--
KTK

JonathanRRogers

unread,
Feb 26, 2014, 5:12:11 PM2/26/14
to jenkins...@googlegroups.com
On Wednesday, February 26, 2014 10:28:49 AM UTC-5, Gyanendra Mishra wrote:

It might be easier to simply re-run the job on failure rather than trying to do something post-build. I accomplish this automatically with Naginator:

<URL:https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Plugin>

Gyanendra Mishra

unread,
Feb 27, 2014, 1:28:19 AM2/27/14
to jenkins...@googlegroups.com

Hello Jonathan,

 

Rerun the whole job would not be helpful if there are 2 tests failure out of 10. Rerun would unnecessarily run all 10 tests again.

 

-Gyanendra

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/NKZBw64cy00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Gyanendra Mishra

unread,
Feb 27, 2014, 1:30:04 AM2/27/14
to jenkins...@googlegroups.com

Hello Kirk,

 

Before making job success, we need to check that post build task status is success.

 

Please help to define how to mark main job as success only if post build task is success.

 

Regards,
Gyanendra Pratap Mishra

From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of KT Kirk
Sent: Thursday, February 27, 2014 2:01 AM
To: jenkins...@googlegroups.com
Subject: Re: How to FInish Job Success even if it failed

 

 

Add a /bin/true on failed statement.

--

Jonathan Rogers

unread,
Feb 27, 2014, 1:42:29 AM2/27/14
to jenkins...@googlegroups.com
Gyanendra Mishra wrote:
> Hello Jonathan,
>
>
>
> Rerun the whole job would not be helpful if there are 2 tests failure
> out of 10. Rerun would unnecessarily run all 10 tests again.

In that case, maybe you should consider putting your conditional test
re-running in a regular build step rather than a post-build action.
Then, you could more easily control whether Jenkins considers the job to
be a failure or success. I doubt you'll find an easy way to tell Jenkins
to consider the job as a success after it's decided it failed.

--
Jonathan Rogers

Maciej Jaros

unread,
Feb 27, 2014, 3:34:09 AM2/27/14
to jenkins...@googlegroups.com
Gyanendra Mishra (2014-02-27 07:30):

Hello Kirk,

 

Before making job success, we need to check that post build task status is success.


You can check build status by analyzing log. You can use Text finder for that. To manually fail a build do a conditional step with Text finder and run shell with `exit 1`.

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.




MOL sp. z o.o. Maciej Jaros
e-mail: mac...@mol.com.pl
WWW: www.mol.pl

tel: 58 669 80 90
fax: 58 669 80 91
 
 

Gyanendra Mishra

unread,
Feb 27, 2014, 5:07:41 AM2/27/14
to jenkins...@googlegroups.com

Hello Maciej,

 

I already tried that but it seems like it is not looking the text in the log of post build task. If I look text for log before post build task, that works.

 

Regards,
Gyanendra Pratap Mishra


image001.gif
Reply all
Reply to author
Forward
0 new messages