1

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?

Community
  • 1
  • 1
Ann
  • 193
  • 1
  • 1
  • 12
  • possible duplicate of [How to run NUnit tests using a template in TFS build server](http://stackoverflow.com/questions/22254538/how-to-run-nunit-tests-using-a-template-in-tfs-build-server) – lloyd May 25 '15 at 13:48
  • @lloydm That link points to 2010, not needed for TFS 2013, which she has. – Terje Sandstrøm May 25 '15 at 17:36
  • The steps outlined in my answer here may help, only the test runner package is different, but the question is essentially the same: http://stackoverflow.com/a/30444295/736079 – jessehouwing May 25 '15 at 20:19

2 Answers2

2

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.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Terje Sandstrøm
  • 1,979
  • 15
  • 14
  • She asks how to find out, which is what I describe – Terje Sandstrøm May 25 '15 at 20:19
  • You make sure the test adapter is installed by looking in the diagnostic run. Then you look in the Run Test section, and it will tell you if you have filtered out or not. There are only those two options why it doesn't work. It should in fact work on any version of TFS 2013, on-premises or VSO. – Terje Sandstrøm May 25 '15 at 20:21
0

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!

Ann
  • 193
  • 1
  • 1
  • 12
  • Just to say that by adding/accepting your own answer which simply duplicates the information given by another user, you're depriving them of reputation and cluttering up this question. – Basic Feb 21 '16 at 14:01