If you do not need the cross-platform properties of ant build step, I would recommend using a shell build step. It is much more flexible and is well suited to running processes and checking their exit codes, as well as capturing and filtering their output in various ways.
-- Sami Adam Tong <adam.to...@gmail.com> kirjoitti 9.2.2013 kello 19.37: > Sorry for the error in the last message, even if the value is true it > does not detect phpunit crash. > > But you answer made me thing about the possibility to personalize my > ant file so that it can detect that. So my question would be more ant > related than jenkins itself. > > Thanks a lot > > On Fri, Feb 8, 2013 at 5:45 PM, Sami Tikka <sjti...@gmail.com> wrote: >> I'm guessing you are using ant to execute phpunit. >> >> Maybe you could tell ant to fail on error. Currently you have told ant to >> ignore the phpunit exit code. >> >> -- Sami >> >> Adam Tong <adam.to...@gmail.com> kirjoitti 9.2.2013 kello 0.17: >> >>> Hi, >>> >>> Here is the section of build.xml that configures the way phpunit is >>> run by jenkins: >>> >>> ------------------- >>> <target name="phpunit" >>> description="Run unit tests using PHPUnit and generates >>> junit.xml and clover.xml"> >>> <exec executable="phpunit" failonerror="false"> >>> <arg value="--configuration" /> >>> <arg value="phpunit.xml.dist"/> >>> </exec> >>> </target> >>> ------------------ >>> >>> It works perfectly, I can see the failures if any and everything.One >>> day, we had a problem with phpunit that was blocking at some level, >>> and I wondered if I can catch that at jenkins level. >>> >>> As you see in the description of the configuration, phpunit generates >>> the files junit.xml and clover.xml. >>> >>> When phpunit crashes I could make a test if one of those files was >>> correctly generated, but I do not know where to insert that test. >>> >>> >>> Thank you >>> >>> On Wed, Feb 6, 2013 at 4:12 PM, Sami Tikka <sjti...@gmail.com> wrote: >>>> We need more details to help you. >>>> >>>> What type of job have you created? >>>> >>>> How exactly are you executing phpunit? What is the build step you use? >>>> Shell, CMD, something else? >>>> >>>> Can you show us the exact command or configuration? >>>> >>>> More information is better than less. >>>> >>>> -- Sami >>>> >>>> Adam Tong <adam.to...@gmail.com> kirjoitti 5.2.2013 kello 21.13: >>>> >>>>> Hi, >>>>> >>>>> Where should I do this check exactly? >>>>> >>>>> Is there a way to do that in build.xml? >>>>> >>>>> Thank you >>>>> >>>>> On Tue, Feb 5, 2013 at 12:03 PM, Mark Waite <markwa...@yahoo.com> wrote: >>>>>> If your call to phpunit is expected to create a file, you could check >>>>>> that >>>>>> file is created and then use "exit 1" to cause the build script to exit >>>>>> with >>>>>> the failure. >>>>>> >>>>>> Mark Waite >>>>>> >>>>>> >>>>>> ________________________________ >>>>>> From: Adam Tong <adam.to...@gmail.com> >>>>>> To: jenkinsci-users@googlegroups.com >>>>>> Sent: Tuesday, February 5, 2013 9:17 AM >>>>>> Subject: Detect command failure? >>>>>> >>>>>> Hi, >>>>>> >>>>>> I am running jenkins on Linux. >>>>>> >>>>>> Yesterday, because of a memory issue, phpunit was not able to run the >>>>>> hole tests suite. However the build was still successful. >>>>>> >>>>>> I understand that if phpunit fails it does not return any errors or >>>>>> failures. >>>>>> >>>>>> Now I am wondering if there is a way to make Jenkins detect this kind of >>>>>> issues. >>>>>> >>>>>> Thank you >>>>>> >>>>>> -- >>>>>> 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. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> -- >>>>> 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. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> -- >>>> 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. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> -- >>> 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. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> -- >> 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. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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. For more options, visit https://groups.google.com/groups/opt_out.