As part of our ASP.NET Core 2.0 build process I have added a dotnet test command which I have added as a Windows batch file.
Here is my command.
dotnet test "MyProject.csproj" --no-restore --results-directory "MyProjectTestResults" --verbosity minimal
And here is the output when run from the command line.
So it all appears to work correctly, yet no test results / test output is created.
To output the test results from dotnet test, you can try pass
-xml /some/path/out.xml
or use thework
parameter, like this:dotnet test --work:"mypath/myresult.xml"
. See below threads for details:Besides, generally you need to specify the argument
-l|--logger <LoggerUri/FriendlyName>
which specifies a logger for test results.e.g.:
dotnet test "myproject.csproj" --logger "trx;LogFileName=pathtotestsfolderresults.trx"
ordotnet test "myproject.csproj" -l:"trx;LogFileName=pathtotestsfolderresults.trx"
To make the generated
trx
files available as test results in VSTS/TFS, you can use the "Publish Test Results" task: