Thank you Baptiste! Tested and it worked. You owe you a beer!
I am new to pipeline programming. I worked several hours today on this and other pipeline related work. Could you please point me to the documentation of this syntax? I must have been looking in the wrong location. Cheers On Tue, Sep 20, 2016 at 10:47 PM, Baptiste Mathus <[email protected]> wrote: > Hi, > > stage('tests') { > parallel 'longTests': { > build job: 'testjob1', quietPeriod: 0 > }, 'shortTests':{ > // this will fail 1 sec > build job: 'testjob2', quietPeriod: 0 > }, failFast: true > > } > > Cheers > > 2016-09-20 22:43 GMT+02:00 Åsmund Østvold <[email protected]>: > >> hi All, >> >> Do anybody have an example or a pointer to how one could terminate a >> parallel pipeline section on first failure? >> >> The use case is that I have 14 tests in a checkin regression pipeline. >> Some tests take 2 min some take 40 min. To speed up feedback to the users >> we want to give feed back ASAP if a test did fail. >> >> My test pipeline is: >> >> stage('tests') { >> parallel 'longTests': { >> build job: 'testjob1', quietPeriod: 0 >> }, 'shortTests':{ >> // this will fail 1 sec >> build job: 'testjob2', quietPeriod: 0 >> } >> } >> >> My current "pipeline" (Build-flow) is able to do this with a ugly hack: >> >> import static hudson.model.Result.FAILURE >> import groovy.time.* >> >> parallel ( >> { b = build("testjob1") >> if (b.getResult().toString() != "SUCCESS") { >> upstream.getExecutor().interrupt(FAILURE) >> } >> }, >> { b = build("testjob2"]) >> if (b.getResult().toString() != "SUCCESS") { >> upstream.getExecutor().interrupt(FAILURE) >> } >> } >> ) >> >> Regard, >> Asmund >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/jenkinsci-users/CA%2BzfM3Bq0x7djYpWaXfvSbHrFf2DuGJeZ8fEs >> VskT%3DDfTeKq2w%40mail.gmail.com >> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BzfM3Bq0x7djYpWaXfvSbHrFf2DuGJeZ8fEsVskT%3DDfTeKq2w%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jenkinsci-users/CANWgJS76kD0W0dTTPeF3P0xXtC1Uo > mAHJ6Swtbog68%3DPDSWyPQ%40mail.gmail.com > <https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS76kD0W0dTTPeF3P0xXtC1UomAHJ6Swtbog68%3DPDSWyPQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BzfM3CAeZ3Kk%2Bh4%3DyU_5sud4d-kf3s0gOEsf6Uqkz42CWWKpg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
