Re: Derative Pipeline: unstable build / best practices

2017-09-18 Thread Andrew Bayer
What's the output of your tests? If they're generating either junit output
or another format that can be read by
https://wiki.jenkins.io/display/JENKINS/xUnit+Plugin, and you're using
junit or xunit to add those test results to your build, any test failure
will result in the build being set to unstable without you having to do
anything else.

A.

On Mon, Sep 18, 2017 at 6:44 AM, zoc  wrote:

> Hello,
>
> I'm still quite new to Jenkins, so please forgive my ignorance and these
> stupid questions:
>
> I have a *declarative pipeline* for which I want to add a new test stage.
> This test result is interesting, but not overly important.
>
> Question 1: Would this be a use case for an *unstable *build result or
> how should I handle this situation instead?
>
> Question 2: If so, what would be the best practice to set a build
> *unstable* in a declarative pipeline?
>
> The one approach I could come up with would be a script {} block in which
> to perform a try/catch and to do something like:
>
> catch (ex) {
>   echo "An error occured in satge 'Compare Databases'. Setting result to
> unstable."
>   currentBuild.result = 'UNSTABLE'
> }
>
> Question 3: When using powershell scripts, what would be the best practice
> to inform the pipeline about errors in these scripts? Exit with error codes
> or throwing exceptions in the powershell scripts?
>
> Thanks very much in advance,
> zoc
>
>
>
>
>
>
> --
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/74e86401-44ef-44c1-9916-fdc27e52e160%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdObhmWV2L36KGLH%2B6Lw5wPSZdJVfA9bHKCmeTkEOeOJ3xA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Derative Pipeline: unstable build / best practices

2017-09-18 Thread zoc
Hello,

I'm still quite new to Jenkins, so please forgive my ignorance and these 
stupid questions:

I have a *declarative pipeline* for which I want to add a new test stage. 
This test result is interesting, but not overly important. 

Question 1: Would this be a use case for an *unstable *build result or how 
should I handle this situation instead?

Question 2: If so, what would be the best practice to set a build *unstable* 
in a declarative pipeline?

The one approach I could come up with would be a script {} block in which 
to perform a try/catch and to do something like: 

catch (ex) {
  echo "An error occured in satge 'Compare Databases'. Setting result to 
unstable."
  currentBuild.result = 'UNSTABLE'
}

Question 3: When using powershell scripts, what would be the best practice 
to inform the pipeline about errors in these scripts? Exit with error codes 
or throwing exceptions in the powershell scripts?

Thanks very much in advance,
zoc






-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/74e86401-44ef-44c1-9916-fdc27e52e160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.