Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2013 automated build: Is there a way to run the tests from the src folder

I'm currently using the default build process template in TFS 2013 for my automated builds.

I've configured the OutputLocation parameter to be AsConfigured to get the same folder structure as my Visual Studio solution (there are multiple projects in the solution and I don't want them all to be dropped in the same folder).

The problem is that when the build process tries to run the tests, it looks for any assembly under the bin folder, while my build configuration makes it so that there is only a src folder.

Is there a way to specify looking into the src folder instead? Shouldn't it be the default anyway when using the AsConfigured setting?

Edit: Just to make it clear, there are usually 3 folders generated when running a TFS automated build (src, bin, tst). When using AsConfigured for the output location, there is no bin folder. I tried a suggestion which required changing the Test sources spec setting of the build process, and I get the same problem as before:

There were no matches for the search pattern C:\Builds\8\MyProject\MyBuildDefinition\bin\***test*.dll
like image 236
Gabriel G. Roy Avatar asked May 12 '14 15:05

Gabriel G. Roy


2 Answers

What I ended up doing is using a PowerShell script as a post-build event to copy my test assemblies to the bin folder of the build.

There are PowerShell scripts made available for TFS 2013 on CodePlex, and I modified this one slightly to accomodate my needs.

By doing this, I was able to use the default settings for running the tests, and it worked like a charm.

like image 183
Gabriel G. Roy Avatar answered Oct 15 '22 18:10

Gabriel G. Roy


In your build definition, change the value of setting "Test Sources spec" to ***test*.dll (assuming your unit tests assemblies are suffixed with .test.dll)

EDIT: Please use **\*test*.dll;**\*test*.appx

like image 35
Hamid Shahid Avatar answered Oct 15 '22 17:10

Hamid Shahid