Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deployment items in .runsettings

I am migrating a large solution from VS 2010 to VS 2013. We have a few thousand tests that do not run when we use a .runsettings file. Our previous test settings file was of the .testsettings type. My understanding (after much frustrated Googling) is that in order to use the new test runner VSTest you need to use a .runsettings file. I haven't been able to find much documentation on what this file can support. This is basically the one resource available: http://msdn.microsoft.com/en-us/library/vstudio/jj635153.aspx

Our previous .testsettings file had a large section for deployment items that now cannot be found and thus the tests fail immediately. The problem is I can't seem to find out if including deployment items is still an option in a .runsettings file.

<Deployment>
  <DeploymentItem filename="C:\Solution\Project\SomeSettings.xml" outputDirectory="C:\Solution\Project\bin" />
</Deployment>

Does the new .runsettings test settings format support doing deployment items?

like image 916
JPRO Avatar asked Apr 04 '14 22:04

JPRO


1 Answers

.runsettings does not support deployment items the same way as with .testsettings unfortunately, and I for one find this very frustrating as it was a very clean way of deploying dependencies. There is a setting related to it in .runsettings (DeploymentEnabled), but all this seems to control is running tests in a separate directory, rather than the application's output directory.

After much trial and error, I ended up just changing all the .csproj files in my test projects to have a CopyIfNewer build action in the Properties window in Visual Studio so that all the dependencies would be copied into the output folder so they'd be found when running the tests.

I think all told I spent about 2-3 hours updating all the tests to get them running again.

On the plus side, things run a lot faster now as there's no need to copy all the binaries to a new directory after they are compiled, as everything runs "in-place".

like image 173
Martin Costello Avatar answered Sep 29 '22 12:09

Martin Costello