Hudson build steps - how to continue the build even one test step is failed

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hudson build steps - how to continue the build even one test step is failed

goldy-2
Hi,

I have multiple test scripts to run in Hudson as separate build steps. But in Hudson if any build step fails it stops the entire build and produces result as failure.Is there any way to skip a build step's result and continue to execute remaining builds?

Regards

Reply | Threaded
Open this post in threaded view
|

Re: Hudson build steps - how to continue the build even one test step is failed

Sami Tikka
What kind of build steps are they? Shell script, batch, ant or what?

-- Sami

2010/1/18 goldy <[hidden email]>:

> Hi,
>
> I have multiple test scripts to run in Hudson as separate build steps. But
> in Hudson if any build step fails it stops the entire build and produces
> result as failure.Is there any way to skip a build step's result and
> continue to execute remaining builds?
>
> Regards
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hudson build steps - how to continue the build even one test step is failed

goldy-2
these are shell scripts.
But i think hudson assumes to build these as separate jobs rather then different steps in a single job.
But you have any other way or plugin to achieve this functionality, kindly reply.


On Thu, Jan 21, 2010 at 2:47 AM, Sami Tikka <[hidden email]> wrote:
What kind of build steps are they? Shell script, batch, ant or what?

-- Sami

2010/1/18 goldy <[hidden email]>:
> Hi,
>
> I have multiple test scripts to run in Hudson as separate build steps. But
> in Hudson if any build step fails it stops the entire build and produces
> result as failure.Is there any way to skip a build step's result and
> continue to execute remaining builds?
>
> Regards
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Hudson build steps - how to continue the build even one test step is failed

Dylan Cali
why do you not run them in a single build step?  Really, the reason to break scripts into separate steps is if you want the build to stop should any one script fail.

Hudson looks at the last exit value of a 'script' step to determine whether that step failed.. so if you have 3 scripts called in one step and there exit values are 1, 1, 0, then the step will 'pass.'

I think you should just wrap your tests in one harness script that always exits 0, then run the harness script in the build step.  This will resolve your problem.

~Dylan



On Wed, Jan 20, 2010 at 10:41 PM, goldy <[hidden email]> wrote:
these are shell scripts.
But i think hudson assumes to build these as separate jobs rather then different steps in a single job.
But you have any other way or plugin to achieve this functionality, kindly reply.



On Thu, Jan 21, 2010 at 2:47 AM, Sami Tikka <[hidden email]> wrote:
What kind of build steps are they? Shell script, batch, ant or what?

-- Sami

2010/1/18 goldy <[hidden email]>:
> Hi,
>
> I have multiple test scripts to run in Hudson as separate build steps. But
> in Hudson if any build step fails it stops the entire build and produces
> result as failure.Is there any way to skip a build step's result and
> continue to execute remaining builds?
>
> Regards
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: Hudson build steps - how to continue the build even one test step is failed

Sami Tikka
I think that depends...

If your build step script has a first line that starts with #!, then
Hudson executes the script with the specified interpreter.

If the first line does not start with #!, Hudson runs the script with
"/bin/sh -xe". The effect of the -e switch is that script will abort
on first error.

The OP could indeed make a single shell script build step that looks like this:

#!/bin/sh -x
STEP1
STEP2
STEP3
STEP4
...

Such a script would run all STEPN steps and the result of whole build
step would be the exit code of the last line of the script. If you
cannot allow even the last line to fail, make "exit 0" be the last
line to force a success to be reported.

It is so easy to make builds pass when you know a little shell scripting :)

-- Sami

2010/1/22 Dylan Cali <[hidden email]>:

> why do you not run them in a single build step?  Really, the reason to break
> scripts into separate steps is if you want the build to stop should any one
> script fail.
>
> Hudson looks at the last exit value of a 'script' step to determine whether
> that step failed.. so if you have 3 scripts called in one step and there
> exit values are 1, 1, 0, then the step will 'pass.'
>
> I think you should just wrap your tests in one harness script that always
> exits 0, then run the harness script in the build step.  This will resolve
> your problem.
>
> ~Dylan
>
>
>
> On Wed, Jan 20, 2010 at 10:41 PM, goldy <[hidden email]> wrote:
>>
>> these are shell scripts.
>> But i think hudson assumes to build these as separate jobs rather then
>> different steps in a single job.
>> But you have any other way or plugin to achieve this functionality, kindly
>> reply.
>>
>>
>> On Thu, Jan 21, 2010 at 2:47 AM, Sami Tikka <[hidden email]> wrote:
>>>
>>> What kind of build steps are they? Shell script, batch, ant or what?
>>>
>>> -- Sami
>>>
>>> 2010/1/18 goldy <[hidden email]>:
>>> > Hi,
>>> >
>>> > I have multiple test scripts to run in Hudson as separate build steps.
>>> > But
>>> > in Hudson if any build step fails it stops the entire build and
>>> > produces
>>> > result as failure.Is there any way to skip a build step's result and
>>> > continue to execute remaining builds?
>>> >
>>> > Regards
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

jc
Reply | Threaded
Open this post in threaded view
|

Re: Hudson build steps - how to continue the build even one test step is failed

jc
This post has NOT been accepted by the mailing list yet.
In reply to this post by goldy-2
I have similar problem and I can't find a way to continue the build process.
My build steps have 'ant' or 'maven' and 'shell script'. The script will send out email when maven
build fail. The email notification plugin on post-build actions doesn't work for me
because I need to attach screenshots and zip file so I need to run as a shell script to use mutt to send
the report. However, hudson wouldn't let me continue when maven fail.
It just stop after maven build without executing my shell script.
I tried to execute the script in release but didn't work. Right now I'm
archiving the report but I rather receive the failed report in email rather than going through browser
to view hudson test report. Any idea on how to force hudson to continue? Thanks.