Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling MSTest temp directory in TeamCity

I'm using TeamCity Professional for building and testing my code continually.

I have some MSTest based tests that work fine in VS2010 on my PC but fail on the build server.

I snooped around and discovered that upon testing, TeamCity creates a temporary directory in it's TEMP_DIR (configurable) and copies only the "first relation" dependencies to the test DLL.

For instance: my test uses NHibernate.dll which is copied to the temp directory but its dependencies (i.e NHibernate.ByteCode.Castle) don't get copied, and the test fails with an IO.FileNotFound exception.

Is there any way I can just run the tests from the test projects output directory (Test/bin/debug)?

If not, how can I specify which DLLs should be copied to the temp directory?

like image 241
Pavel Tarno Avatar asked Nov 29 '11 15:11

Pavel Tarno


1 Answers

You can add a TestSettings file in your solution that will describe all the files to deploy.

First, add a TestSettings file. Open it, and in the "Deployment" tab, add all the file you need (your .dll). Then on TeamCity, in the MSTest build step, specifiy the TestSettings file to use in the "Additional command parameters" area. Exemple: "/testsettings:Local.Testsettings"

This way, all the files you specify in the deployment items will be copied in the temp directory.

like image 84
Julien Coqueret Avatar answered Nov 09 '22 04:11

Julien Coqueret