How to make jenkins job as unstable after TestNG Failures











up vote
-1
down vote

favorite












I have configured my test scripts to run from Jenkins using TestNG XML. This xml triggers a suite of testcases from my available test suite. This xml is triggered using a batch file and configured as a build step in Jenkins.



Issue:



Though some of my test case is failing, jenkins job is reporting as Pass since the batch script was completed successfully.



Is there a way to pass the Failure report back to batch file and then to Jenkins to report fail if any test case in the suite failed.










share|improve this question
























  • Isn't there a Jenkins plugin for TestNG? Are you using it?
    – JeffC
    Nov 6 at 2:12










  • Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
    – Anto
    Nov 6 at 16:29















up vote
-1
down vote

favorite












I have configured my test scripts to run from Jenkins using TestNG XML. This xml triggers a suite of testcases from my available test suite. This xml is triggered using a batch file and configured as a build step in Jenkins.



Issue:



Though some of my test case is failing, jenkins job is reporting as Pass since the batch script was completed successfully.



Is there a way to pass the Failure report back to batch file and then to Jenkins to report fail if any test case in the suite failed.










share|improve this question
























  • Isn't there a Jenkins plugin for TestNG? Are you using it?
    – JeffC
    Nov 6 at 2:12










  • Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
    – Anto
    Nov 6 at 16:29













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have configured my test scripts to run from Jenkins using TestNG XML. This xml triggers a suite of testcases from my available test suite. This xml is triggered using a batch file and configured as a build step in Jenkins.



Issue:



Though some of my test case is failing, jenkins job is reporting as Pass since the batch script was completed successfully.



Is there a way to pass the Failure report back to batch file and then to Jenkins to report fail if any test case in the suite failed.










share|improve this question















I have configured my test scripts to run from Jenkins using TestNG XML. This xml triggers a suite of testcases from my available test suite. This xml is triggered using a batch file and configured as a build step in Jenkins.



Issue:



Though some of my test case is failing, jenkins job is reporting as Pass since the batch script was completed successfully.



Is there a way to pass the Failure report back to batch file and then to Jenkins to report fail if any test case in the suite failed.







batch-file jenkins testng jenkins-plugins






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 15:19









Navarasu

1,5181719




1,5181719










asked Nov 5 at 22:21









Anto

61




61












  • Isn't there a Jenkins plugin for TestNG? Are you using it?
    – JeffC
    Nov 6 at 2:12










  • Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
    – Anto
    Nov 6 at 16:29


















  • Isn't there a Jenkins plugin for TestNG? Are you using it?
    – JeffC
    Nov 6 at 2:12










  • Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
    – Anto
    Nov 6 at 16:29
















Isn't there a Jenkins plugin for TestNG? Are you using it?
– JeffC
Nov 6 at 2:12




Isn't there a Jenkins plugin for TestNG? Are you using it?
– JeffC
Nov 6 at 2:12












Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
– Anto
Nov 6 at 16:29




Yes i guess i have installed the TestNG plugin, but i dont see any support for execution of testNG XML. I have an option to publish testNG results though.
– Anto
Nov 6 at 16:29












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Use TestNG Results Plugin, https://plugins.jenkins.io/testng-plugin.



Then publish the testng result by providing appropriate path to the testng-result.xml. The job will turn yellow on failures.



enter image description here






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53163100%2fhow-to-make-jenkins-job-as-unstable-after-testng-failures%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Use TestNG Results Plugin, https://plugins.jenkins.io/testng-plugin.



    Then publish the testng result by providing appropriate path to the testng-result.xml. The job will turn yellow on failures.



    enter image description here






    share|improve this answer

























      up vote
      0
      down vote













      Use TestNG Results Plugin, https://plugins.jenkins.io/testng-plugin.



      Then publish the testng result by providing appropriate path to the testng-result.xml. The job will turn yellow on failures.



      enter image description here






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Use TestNG Results Plugin, https://plugins.jenkins.io/testng-plugin.



        Then publish the testng result by providing appropriate path to the testng-result.xml. The job will turn yellow on failures.



        enter image description here






        share|improve this answer












        Use TestNG Results Plugin, https://plugins.jenkins.io/testng-plugin.



        Then publish the testng result by providing appropriate path to the testng-result.xml. The job will turn yellow on failures.



        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 14:09









        Navarasu

        1,5181719




        1,5181719






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53163100%2fhow-to-make-jenkins-job-as-unstable-after-testng-failures%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()