Using AsConfigured and still be able to get UnitTest results in TFS

mstest, tfs, tfsbuild, unit-testing

Solution

What I ended up doing was adding a post build event to copy all of the test.dll into the staging location folder in the specific build that is basically equivalent to where it would go on a SingleFolder build and do that on each test project.

if "$(TeamBuildOutDir)" == "" (
echo "Building Interactively not in TFS"
) else (
echo "Building in TFS"
xcopy "$(TargetDir)*.*" "$(TeamBuildBinaries)\" /Y /E /S
)

MSBUILD parameter in the build def that told it to basically drop in the folder that TFS looks for them.

/p:TeamBuildBinaries="$(TF_BUILD_BINARIESDIRECTORY)"

Kept the default Test assembly file specification:

**\*test*.dll

View this link for the information on the variable that I used and what relative path it exists at.

Problem

So I am running into an issue when I go to build my projects using tfs build controller using the Output location "AsConfigred" it will not detect my unit tests. Let me give a little info on my setup. TFS 2013 Update 2, Default Process Template Here is a few screenshots that can hopefully help fill in what I can't in typing. I am copying my build out to a file share on our network so that we can use other utilities use the output. I don't want to use "PerProject" or "SingleFolder" because they mess up the file structure we have configured (These both will run the tests). So i have the files copy to folder names "SingleOutputFolder" which is a child of the DropLocation. I would like to be able to run from the drop folder or run from the bin folder for each of my tests (I don't care which). However it doesn't seem to detect/run ANY of the tests. Any help would be greatly appreciated. Please let me know if you need any additional information. I have tried using ***test*.dll, Install\SingleFolderOutput**.test.dll, and $(TF_BUILD_DROPLOCATION)\Install\SingleFolderOutput*test*.dll But I am not sure what variables are available and understand where the scope of its execution is.

Original source