Forum Discussion

dbob's avatar
dbob
New Contributor
3 years ago

Set a Jenkins pipeline to success if the rerun succeded

Hi

I have a TestComplete project, with Keyword tests.  The test

  • On error property is set to "Use projects 'On Error' property"
  • The project On Error property is set to rerun
  • Rerun is set to 1

If a test fails the first time, and it passes the second, the result code is 2, which means there has been errors.

Is there a way to set the build to success if the rerun was successful?  For example, on other tools an different exit code is returned, which can then be used to set the Jenkins status.

  • Kitt's avatar
    Kitt
    Regular Contributor

    See the [TestComplete reference here and here] on setting up exit codes:

    "If your tests are run automatically (for example, by using the command line or from a CI system like Jenkins), you may want to get and analyze the TestComplete exit code to check whether your test run has passed or failed.
    
    If your TestComplete project is configured to rerun failed test items, the exit code that TestComplete returns corresponds to the test session status you see in the Summary report. For instance, if a test item fails and then reruns successfully, the exit code will specify that the test session has been successful."

     

  • dbob's avatar
    dbob
    New Contributor

    Hi,

    If a test fails the first time, and it passes the second, the result code is 2, which means there has been errors.
    I've just realised maybe its because there is a Log.Error when the test fails at a certain point, and this causes the exit code of 2.