nunit.testlogger icon indicating copy to clipboard operation
nunit.testlogger copied to clipboard

NUnit.Testlogger ignores LogFileName parameter

Open gkalnytskyi opened this issue 6 years ago • 2 comments

There are two issues with the names of test result files:

  1. If not LogFileName parameter is specified as in --logger=nunit then default file name will be "TestResults.xml", while for html/trx loggers that will be "_
  2. If you specify LogFileName (e.g. --logger=nunit;LogFileName=nunit3.xml) this parameter is ignored by the log adapter and TestResults.xml file is produced instead.

Project Framework: .Net Core 2.1 NunitXml.TestLogger: 2.1.41

gkalnytskyi avatar Oct 24 '19 06:10 gkalnytskyi

For (1), can you clarify some more on the convention? Are you expecting a *.trx file output from this logger? Or is it the name of the file that should be different?

For (2) can you try --logger="nunit;LogFileName=nunit3.xml"? ; is sometimes interpreted by the command prompt.

codito avatar Oct 25 '19 13:10 codito

Hello @codito, (1) I'm not expecting the MSTest trx file. I expect the default name have the format <UserName>_<VMName>_<Date in yyyy-MM-dd>_<Time in hh_mm_ss>.xml. (2) Here is almost exact command that I was running in CMD and Powershell

dotnet test <path to .net core 2.1 project file> --configuration Debug --settings .\BbswAutotestNunit.runsettings --results-directory .\test-results\ --logger:"nunit;LogFileName=nunit3.xml" --test-adapter-path:.

The result is the same for both CMD and Powershell file with name TestResults.xml gets created.

gkalnytskyi avatar Oct 27 '19 21:10 gkalnytskyi