Thanks!
For now I go with this (I hate whitelisting...):
if(currentBuild.result != null && !"SUCCESS".equals(currentBuild.result)) {
...
}
> On 22 Mar 2016, at 09:42, Robert Sandell <[email protected]> wrote:
>
> Pro tip, requires some "custom whitelisting":
>
> AbstractTestResultAction testResultAction =
> currentBuild.rawBuild.getAction(AbstractTestResultAction.class)
> if (testResultAction != null) {
> echo "Tests: ${testResultAction.failCount}
> ${testResultAction.failureDiffString} failures of
> ${testResultAction.totalCount}.\n\n"
> }
>
> On Tue, Mar 22, 2016 at 5:12 AM, Michael Neale <[email protected]
> <mailto:[email protected]>> wrote:
> OK sorry for the confusion,
>
> but you should be able to do what you do (so it doesn't fail on the sh step,
> but then marks the build as UNSTABLE in the junit archive step).
> Then currentBuild.result should have the current build status (or another
> item in currentBuild, sorry am not sure).
>
> On Tuesday, March 22, 2016 at 3:03:12 PM UTC+11, Michael Neale wrote:
> Right but then without the step failure how can you trap the failure to send
> the failure email (seems clumsy to have to let the step fail, and then record
> archive results in the exception handler).
>
> On Tuesday, March 22, 2016 at 2:51:31 PM UTC+11, Andrew Bayer wrote:
> I think the Junit result archiver should mark the build as unstable if there
> are failures...
>
> On Mar 21, 2016 7:16 PM, "Michael Neale" <[email protected] <>> wrote:
> I am assuming that ignoring test failures doesn't make the shell step fail?
> (Ie it returns a success code?)
>
> If so, removing that and putting try/catch around it and then the archive
> step in the exception handler along with email could work. There may be a
> better way though (as that seems clumsy)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/8617dfa6-1348-4a16-93c3-eff3dfca871a%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jenkinsci-dev/8617dfa6-1348-4a16-93c3-eff3dfca871a%40googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/26c5a998-58e2-423b-bc53-8fae37399207%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jenkinsci-dev/26c5a998-58e2-423b-bc53-8fae37399207%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
> --
> Robert Sandell
> Software Engineer
> CloudBees Inc.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS38jF3XSveXTp_J2KW3UYF5YnsNuACfVAg235PQpBuc1g%40mail.gmail.com
>
> <https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS38jF3XSveXTp_J2KW3UYF5YnsNuACfVAg235PQpBuc1g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/E5A89E0B-CA64-4FA0-88EE-9B8C994D8F29%40fortysix.ch.
For more options, visit https://groups.google.com/d/optout.