1
votes

I have a simple application and Nunit unit test project with 2 tests to test that app. I've managed to have unit tests discovered and run locally in Visual studio 2013 but when trying to build application and run these unit tests on TFS 2013 test runner does not find tests ( both projects are built successfully.

No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

I've added "NUnit adapter with framework" package to Unit tests project according to answer in this question and committed changes to the TFS. Unit tests projects is successfully built but still no tests are found. The Test dll fits the **\*Test*.dll naming pattern as configured in the Build Definition.

Why no tests are found? How I can make sure Test Runner is aware of my NUnit test adapter?

2
@lloydm That link points to 2010, not needed for TFS 2013, which she has.Terje Sandstrøm
The steps outlined in my answer here may help, only the test runner package is different, but the question is essentially the same: stackoverflow.com/a/30444295/736079jessehouwing

2 Answers

2
votes

If you go to the build, and look in diagnostics (from the web portal), there is a Run VS Test Runner section.

In the same log, there is a Run MSBuild section, it should say "Successfully installed xxxx" where xxx is the name of your adapter package.

Something like: Diagnostic results

Check to see that the test runner is successfully restored.

0
votes

Found the reason - build agent folder in source settings of Build definition was not set correctly - instead of setting it somewhere under build agent working folder I set it outside of it that's why unit tests were not found..

I discovered this using Build process activity log (which was saved in drop folder in my case).this log contains very detailed information (much more than you can see in Visual studio) - there I found in which location test runner is looking for unit tests and then understood what i did wrong. That's what I saw in log:

Run VS Test Runner00:00:00
Inputs 
TestSpecs: BuildParameter[] Array 
Enabled: True 
ConfigurationsToTest: String[] Array 
OutDir: 
There were no matches for the search pattern C:\Builds\11\XXXX\Application -Gated\bin\**\*Test*.dll

Hope this will be helpful to someone else.

thanks to everyone who responded to my question!