Generate result report testing with xunit using .NET core












5















I have a project ASP.NET core which I integrate unit test with xUnit , Everything work fine but I want to genrate xml report test to integrate in jenkins .
Any help please :)



My project.json is :



{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"Microsoft.NETCore.App": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
}
}
},
"runtimes": {
"ubuntu.16.04-x64": {},
"win10-x64": {},
"debian.8-x64": {},
"win81-x64": {}
}


}



I'm using the plugin xunit jenkins to display my result test .
If their are another way tell me .










share|improve this question


















  • 1





    Is your xUnit framework is generating xml reports for the tests or not?

    – RejeeshChandran
    Jan 17 '17 at 6:39











  • I don't know how make xUnit generate xml reports this is my question in .NET core

    – Abbes Yassine
    Jan 17 '17 at 9:27


















5















I have a project ASP.NET core which I integrate unit test with xUnit , Everything work fine but I want to genrate xml report test to integrate in jenkins .
Any help please :)



My project.json is :



{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"Microsoft.NETCore.App": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
}
}
},
"runtimes": {
"ubuntu.16.04-x64": {},
"win10-x64": {},
"debian.8-x64": {},
"win81-x64": {}
}


}



I'm using the plugin xunit jenkins to display my result test .
If their are another way tell me .










share|improve this question


















  • 1





    Is your xUnit framework is generating xml reports for the tests or not?

    – RejeeshChandran
    Jan 17 '17 at 6:39











  • I don't know how make xUnit generate xml reports this is my question in .NET core

    – Abbes Yassine
    Jan 17 '17 at 9:27
















5












5








5


1






I have a project ASP.NET core which I integrate unit test with xUnit , Everything work fine but I want to genrate xml report test to integrate in jenkins .
Any help please :)



My project.json is :



{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"Microsoft.NETCore.App": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
}
}
},
"runtimes": {
"ubuntu.16.04-x64": {},
"win10-x64": {},
"debian.8-x64": {},
"win81-x64": {}
}


}



I'm using the plugin xunit jenkins to display my result test .
If their are another way tell me .










share|improve this question














I have a project ASP.NET core which I integrate unit test with xUnit , Everything work fine but I want to genrate xml report test to integrate in jenkins .
Any help please :)



My project.json is :



{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"Microsoft.NETCore.App": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
}
}
},
"runtimes": {
"ubuntu.16.04-x64": {},
"win10-x64": {},
"debian.8-x64": {},
"win81-x64": {}
}


}



I'm using the plugin xunit jenkins to display my result test .
If their are another way tell me .







jenkins asp.net-core continuous-integration xunit xunit.net






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 17 '17 at 1:43









Abbes YassineAbbes Yassine

1,172814




1,172814








  • 1





    Is your xUnit framework is generating xml reports for the tests or not?

    – RejeeshChandran
    Jan 17 '17 at 6:39











  • I don't know how make xUnit generate xml reports this is my question in .NET core

    – Abbes Yassine
    Jan 17 '17 at 9:27
















  • 1





    Is your xUnit framework is generating xml reports for the tests or not?

    – RejeeshChandran
    Jan 17 '17 at 6:39











  • I don't know how make xUnit generate xml reports this is my question in .NET core

    – Abbes Yassine
    Jan 17 '17 at 9:27










1




1





Is your xUnit framework is generating xml reports for the tests or not?

– RejeeshChandran
Jan 17 '17 at 6:39





Is your xUnit framework is generating xml reports for the tests or not?

– RejeeshChandran
Jan 17 '17 at 6:39













I don't know how make xUnit generate xml reports this is my question in .NET core

– Abbes Yassine
Jan 17 '17 at 9:27







I don't know how make xUnit generate xml reports this is my question in .NET core

– Abbes Yassine
Jan 17 '17 at 9:27














2 Answers
2






active

oldest

votes


















1














I find the solution , just add -xml ./path/out.xml .
It seems like this :




dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml







share|improve this answer



















  • 1





    how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

    – code4cause
    Feb 2 '17 at 15:27











  • I finded in another issue in github by luck . Yes It's not documented unfortunately

    – Abbes Yassine
    Feb 2 '17 at 18:06






  • 3





    The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

    – Luke
    Feb 21 '17 at 4:38






  • 1





    One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

    – Ole Tolshave
    Apr 22 '17 at 6:52



















0














I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:




  1. add NunitXml.TestLogger package to the test project



  2. Run tests using this logger:



    dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"



The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.






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',
    autoActivateHeartbeat: false,
    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%2f41687793%2fgenerate-result-report-testing-with-xunit-using-net-core%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I find the solution , just add -xml ./path/out.xml .
    It seems like this :




    dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml







    share|improve this answer



















    • 1





      how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

      – code4cause
      Feb 2 '17 at 15:27











    • I finded in another issue in github by luck . Yes It's not documented unfortunately

      – Abbes Yassine
      Feb 2 '17 at 18:06






    • 3





      The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

      – Luke
      Feb 21 '17 at 4:38






    • 1





      One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

      – Ole Tolshave
      Apr 22 '17 at 6:52
















    1














    I find the solution , just add -xml ./path/out.xml .
    It seems like this :




    dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml







    share|improve this answer



















    • 1





      how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

      – code4cause
      Feb 2 '17 at 15:27











    • I finded in another issue in github by luck . Yes It's not documented unfortunately

      – Abbes Yassine
      Feb 2 '17 at 18:06






    • 3





      The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

      – Luke
      Feb 21 '17 at 4:38






    • 1





      One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

      – Ole Tolshave
      Apr 22 '17 at 6:52














    1












    1








    1







    I find the solution , just add -xml ./path/out.xml .
    It seems like this :




    dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml







    share|improve this answer













    I find the solution , just add -xml ./path/out.xml .
    It seems like this :




    dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 17 '17 at 10:52









    Abbes YassineAbbes Yassine

    1,172814




    1,172814








    • 1





      how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

      – code4cause
      Feb 2 '17 at 15:27











    • I finded in another issue in github by luck . Yes It's not documented unfortunately

      – Abbes Yassine
      Feb 2 '17 at 18:06






    • 3





      The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

      – Luke
      Feb 21 '17 at 4:38






    • 1





      One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

      – Ole Tolshave
      Apr 22 '17 at 6:52














    • 1





      how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

      – code4cause
      Feb 2 '17 at 15:27











    • I finded in another issue in github by luck . Yes It's not documented unfortunately

      – Abbes Yassine
      Feb 2 '17 at 18:06






    • 3





      The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

      – Luke
      Feb 21 '17 at 4:38






    • 1





      One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

      – Ole Tolshave
      Apr 22 '17 at 6:52








    1




    1





    how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

    – code4cause
    Feb 2 '17 at 15:27





    how did you find this switch? it appears to be undocumented? when you do a dotnet test --help it doesn't give you any "help" about outputting results.

    – code4cause
    Feb 2 '17 at 15:27













    I finded in another issue in github by luck . Yes It's not documented unfortunately

    – Abbes Yassine
    Feb 2 '17 at 18:06





    I finded in another issue in github by luck . Yes It's not documented unfortunately

    – Abbes Yassine
    Feb 2 '17 at 18:06




    3




    3





    The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

    – Luke
    Feb 21 '17 at 4:38





    The support for -xml switch has been dropped in more recent versions of msbuild github.com/dotnet/cli/issues/3114 although you can now output to trx using the --logger:trx switch (as described github.com/dotnet/cli/pull/5181), but I'm now unsure how to get that showing in Jenkins

    – Luke
    Feb 21 '17 at 4:38




    1




    1





    One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

    – Ole Tolshave
    Apr 22 '17 at 6:52





    One way to do it: add " --logger=trx" to the "dotnet test" command and then use the build step "Process xUnit test result report" from the "xUnit plugin". Use the option "MSTest-Version N/A (default) Pattern" and set pattern to "*/.trx".

    – Ole Tolshave
    Apr 22 '17 at 6:52













    0














    I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:




    1. add NunitXml.TestLogger package to the test project



    2. Run tests using this logger:



      dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"



    The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.






    share|improve this answer




























      0














      I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:




      1. add NunitXml.TestLogger package to the test project



      2. Run tests using this logger:



        dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"



      The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.






      share|improve this answer


























        0












        0








        0







        I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:




        1. add NunitXml.TestLogger package to the test project



        2. Run tests using this logger:



          dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"



        The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.






        share|improve this answer













        I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:




        1. add NunitXml.TestLogger package to the test project



        2. Run tests using this logger:



          dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"



        The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 16:51









        AlexeiAlexei

        11.2k116373




        11.2k116373






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41687793%2fgenerate-result-report-testing-with-xunit-using-net-core%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas