spekt / xunit.testlogger

XUnit logger for vstest platform
MIT License
73 stars 15 forks source link

how it works? #39

Closed AmeerMansourBeca closed 10 months ago

AmeerMansourBeca commented 1 year ago

sorry but i didn't understand this point

Use the following command line in tests dotnet test --logger:xunit Test results are generated in the TestResults directory relative to the test.csproj A path for the report file can be specified as follows:

dotnet test --logger:"xunit;LogFilePath=test_result.xml"

can I use it to automatically generate reports automatically after my tests run?

crainey commented 1 year ago

Yes, you use the test_results.xml file as the input into a tool of your choice that can generate reports. One example of this is if you are using Jenkins for your builds, you can use this jenkins plugin to display the results based on the test_results.xml file. https://plugins.jenkins.io/xunit/

Siphonophora commented 1 year ago

@AmeerMansourBeca Yeah, thats right. After you add the nuget package to your test project, use the command line in the directory with your test csproj to run dotnet test --logger:xunit. You will see in the console where your report was written.

As @crainey said, you can run the same command in your CICD pipeline and then have the xml file saved into whatever system you are using.

codito commented 10 months ago

Closing due to inactivity. Please reopen as appropriate.