nunit.testlogger
nunit.testlogger copied to clipboard
NUnit.Testlogger ignores LogFileName parameter
There are two issues with the names of test result files:
- If not
LogFileNameparameter is specified as in--logger=nunitthen default file name will be "TestResults.xml", while for html/trx loggers that will be "_ - If you specify
LogFileName(e.g.--logger=nunit;LogFileName=nunit3.xml) this parameter is ignored by the log adapter andTestResults.xmlfile is produced instead.
Project Framework: .Net Core 2.1 NunitXml.TestLogger: 2.1.41
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.
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.