loresoft / msbuildtasks

The MSBuild Community Tasks Project is an open source project for MSBuild tasks.
BSD 2-Clause "Simplified" License
946 stars 271 forks source link

Nunit3 task does not log anything on to the console #235

Open varunthakur2480 opened 8 years ago

varunthakur2480 commented 8 years ago

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.

stevewi1950 commented 8 years ago

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

varunthakur2480 commented 8 years ago

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)

stevewi1950 commented 8 years ago

Hi @varunthakur2480

I couldn't see the options in your reply ?

stevewi1950 commented 8 years ago

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.

``` ``` [NUnt3Output.txt](https://github.com/loresoft/msbuildtasks/files/472836/NUnt3Output.txt) Regards Steve.
varunthakur2480 commented 8 years ago

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

stevewi1950 commented 8 years ago

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.

varunthakur2480 commented 8 years ago

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

stevewi1950 commented 8 years ago

No probs. Glad to be of help.