spekt / xunit.testlogger

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

Dotnet test Solution file does not create a result per test project #21

Closed mubeda closed 3 years ago

mubeda commented 4 years ago

Basically the problem happens when a solution has more the one Xunit test project. So if you execute "dotnet test" for the solution TestResult.xml is always overwrite by the last executed unit test project. May be a solution could be to create a time stamp based file name if LogFilePath is not specified.

Siphonophora commented 4 years ago

@mubeda Could you share the full command line arguments you are using?

mubeda commented 4 years ago

Sure! dotnet test --logger xunit --configuration Debug --results-directory X:\test02\ --no-build. At on the directory where the solution file is located.

Siphonophora commented 4 years ago

@mubeda Thanks. This logger doesn't have an option to modify the file name per project, like some of our other loggers. We are working on making these features consistent across the loggers, but it will still be a little while before thats done.

For now, I would suggest running with the folder as an argument, so you run one command per project and can name them separately.
dotnet test .\ProjectOne --logger:"xunit;LogFilePath=ProjectOne_test_result.xml"

mubeda commented 4 years ago

Tks!! For the moment i cloned the repo, and did little changes to create files using the combination of FileName+TIMESTAMP. That solved my problem for the moment, until you can work on them. Tks!

jdelucaa commented 3 years ago

This one would be a great addition :)

codito commented 3 years ago

Supported with {assembly} and {framework} token in options in 3.0.56 release. Documentation for this feature is at https://github.com/spekt/testlogger/wiki/Logger-Configuration