3

I'm trying to get TFS to run my unit tests.

The name of the project assembly is Users.SystemTests.dll. It's located in ~/source/Users.SystemTests/bin/debug. The solution file is located in ~/source/Users.sln.

I've included the Nunit.VisualStudio.TestAdapter nuget package the in test assembly project.

enter image description here

The results of the build shows that the tests don't run.

enter image description here

What am I missing? They run fine locally via the Resharper test runner and I can also use nunit-console-x86.exe to run them.

Does this have something to do with the fact that I'm building a solution file? Maybe it's the output location being "AsConfigured?"

SteveC
  • 15,808
  • 23
  • 102
  • 173
Darthg8r
  • 12,377
  • 15
  • 63
  • 100
  • possible duplicate of [Visual Studio Online CI Nunit Tests not found during build](http://stackoverflow.com/questions/20027235/visual-studio-online-ci-nunit-tests-not-found-during-build) – Daniel Mann Dec 18 '14 at 21:11
  • Negative, the suggestion in the answer to that question is to use the nuget test adapter, which I mentioned that I am using, but it's still not working. – Darthg8r Dec 18 '14 at 21:52

2 Answers2

0

Ok, so I tracked this down on my own. It was twofold. The first problem was the the TestAdapter was not being output to the bin directory. The other piece was the Output Location. Setting copy local and then Output Location SingleFolder fixed the issue.

Darthg8r
  • 12,377
  • 15
  • 63
  • 100
  • You should only need to set SingleFolder. The build will find the adapter, but the singlefolder ensures it also finds your test dlls. – Terje Sandstrøm Dec 18 '14 at 23:18
0

I do believe this is a bug in the tfs build. It works when you use SingleFolder or PerProject, but not AsConfigured. In the latter case the test runner don't find the testassemblies, and this is the same for both NUnit and MSTest, so it is not adapter specific.

The diagnostics log says:

Run VS Test Runner00:00:00
There were no matches for the search pattern C:\a\bin\**\*test*.dll
There were no matches for the search pattern C:\a\bin\**\*test*.appx
Terje Sandstrøm
  • 1,979
  • 15
  • 14