msbuildtasks icon indicating copy to clipboard operation
msbuildtasks copied to clipboard

Nunit3 task does not log anything on to the console

Open varunthakur2480 opened this issue 8 years ago • 8 comments

The Nunit3 task simply loads the Dll's in separate instances and runs tests , it does not log any output onto the console not even the summary of total tests at the end of the run. This is very problematic as the screen seems to freeze for the duration of the tests and devs cannot be sure of the results , they also have to wait for all tests to finish. I think the problem is with Nunit3 as Nunit3-console.exe works flawlessly.

varunthakur2480 avatar Sep 13 '16 06:09 varunthakur2480

Hi @varunthakur2480.

I quickly tested this against a build I had kicking about on my laptop and got some output on the console. I get output from any tests that have outputted data to the console and also get feedback of what test is running. I an running the task and have the verbose option turned on. How are you running the task and what are you passing to it ?

Regards

stevewi1950 avatar Sep 13 '16 20:09 stevewi1950

Hi Steve, I am running nunit3 task on multiple assemblies and assume that you also tested in multi threaded setup.Here are the options I used NUnit3 Assemblies="@(NUnitTestAssemblies->'%(FullPath)')" Process="Multiple" TestTimeout="360000" Framework="v4.0" Force32Bit="true" Workers="1" EnableShadowCopy="false" ToolPath="$(NUnit3RunnerDir)\tools" OutputXmlFile="$(UnitTestLogDir)\MyTestOutput.xml" WorkingDirectory="./" ShowLabels="All" InternalTrace="" TextOutputFile="$(UnitTestLogDir)\TestOutput.txt" ErrorOutputFile="$(UnitTestLogDir)\TestErrorOutput.txt" Verbose="true" Where ="cat !=/$(UnitTestCategoryExcludes)

varunthakur2480 avatar Sep 14 '16 03:09 varunthakur2480

Hi @varunthakur2480

I couldn't see the options in your reply ?

stevewi1950 avatar Sep 14 '16 14:09 stevewi1950

Hi @varunthakur2480.

This is the NUnit3 usage in my test proj file and below is attached the output from the cmd line. In one of the test fixtures in Setup I output "Setup output" on the console to show that the redirection of the std out from the test is working correctly.

Hope this is useful.

  <NUnit3 Assemblies="@(TestAssemblies)" 
          Process="Multiple" 
          TestTimeout="2000" 
          Framework="v4.0" 
          Force32Bit="true" 
          Workers="10" 
          EnableShadowCopy="true" 
          OutputXmlFile="myTestOutput.xml"
          WorkingDirectory="./"
          ShowLabels="All"
          NoHeader="true"
          NoColor="true"
          Verbose="true"/>
</Target>

NUnt3Output.txt

Regards Steve.

stevewi1950 avatar Sep 14 '16 17:09 stevewi1950

Updated the comment , seems that it does not display traditional msbuild tags that start with <

varunthakur2480 avatar Sep 15 '16 03:09 varunthakur2480

Hi.

I ran my tests again on the command line through msbuild with your settings and yes you don't get any feedback on what tests are running as you have redirected the output from the task to the TextOutputFile location. I still got a summary though so not 100% why you are not getting this when you are running the task through msbuild. If you remove the TextOutputFile and ErrorOutputFile attributes and see what you get. Hopefully you will get the correct test output....

Regards.

stevewi1950 avatar Sep 15 '16 17:09 stevewi1950

thanks for looking into this , it turns out that it was a combination of two issues,

  1. Redirection of logs as you mentioned above
  2. I was calling the msbuild from a command file which had the verbosity set to minimal

varunthakur2480 avatar Sep 20 '16 10:09 varunthakur2480

No probs. Glad to be of help.

stevewi1950 avatar Sep 20 '16 11:09 stevewi1950