How to get Jenkins to fail build with test failures?

sbrittonsbritton Posts: 10

I have SOATest running through Jenkins, however I am seeing that if tests fail, the Jenkins build is still showing as passing. Is there something I need to add to my cli command to have it exit correctly?

Also, I'm having reports published by Jenkins, but when I look in the workspace at the reports, the View Traffic link doesn't pull up the traffic log, the links seem static.

Tagged:

Best Answers

Answers

  • OmarROmarR Posts: 205 admin

    Hello Sbritton,

    The Jenkins build succeeds because it was able to execute your SOAtest tests successfully. I recommend looking into the Jenkins plugin for SOAtest which allows you to integrate your test results directly into your Jenkins Job.


    You may download the plugin on Parasoft Marketplace or Jenkins Marketplace.

  • benken_parasoftbenken_parasoft Posts: 503 ✭✭✭
    edited October 2017

    Are you using Parasoft Findings? This will do the job.
    https://wiki.jenkins.io/display/JENKINS/Parasoft+Findings+Plugin

    Parasoft Findings leverages the xUnit Jenkins plugin which has configurable thresholds for marking builds as unstable or failed.

  • sbrittonsbritton Posts: 10

    @benken_parasoft @OmarR Thanks I'll look into how to get the plugin to work, I haven't had much success and can't get anything to generate. Is there a working example you guys have that can show me the Jenkins configuration used to generate the graphs?

    Also, regarding my second question, should the Jenkins workspace where reports are saved be able to display the links within the report?

  • sbrittonsbritton Posts: 10
    edited October 2017

    Interesting! In the help documentation that I had prior to 9.10.3 didn't have the -fail option documented. This weekend I updated to 9.10.3. After reviewing the blog post to verify that option works, I removed all post build actions and adding -fail will cause the build to fail, which is exactly what I was looking for.

    Thanks, guys! I'll review your suggestions with my team tomorrow and get this stuff working in Jenkins. Appreciate all the help!

  • benken_parasoftbenken_parasoft Posts: 503 ✭✭✭

    In the help documentation that I had prior to 9.10.3 didn't have the -fail option documented

    For reference, there is also soatestcli -help which prints:

    -fail
        Fail the build by returning a non-zero exit code if any violations are
        reported.
    

    However, I do think Parasoft Findings still offers a lot of value beyond from making builds fail based on test results. We really appreciate feedback about things like this.

Sign In or Register to comment.