I'm trying to run MS tests from the build folder on the TeamCity.
Main reason is that our application uses several configuration files (csv files with 'Copy to Output Directory' option set), that are loaded from its run folder. Those are not test files, but required application files, so using MSTest deploy attribute is not an option.
Locally, R# and VS2013 run tests correctly, on the TeamCity (8.1) I get an error - csv files are missing.
I tried using .runsettings file ("Build Step configuration/MSTest run configuration file") to specify <DeploymentEnabled>False</DeploymentEnabled>
however MSTest (12.0.21005.1) returns this error:
"The file 'C:\TeamCity\buildAgent\work\d6160ab253397620\tests.runsettings' has unknown format and cannot be converted to the current version."
The file is dead simple (copied from msdn):
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<CaptureTraceOutput>false</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>False</DeploymentEnabled>
</MSTest>
</RunSettings>
I'm banging my head over this for the last 2 hours and I can't believe, that something so simple is so hard to accomplish using MSTest.
[Edit]
It seems that the file should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings
id="b8968a45-0b6a-40a9-bcf7-7573da114965"
name="MSTest"
enableDefaultDataCollectors="false"
xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description><!--_locID_text="Description1"-->These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
</TestSettings>
...but it still doesn't work: tests are run in a custom folder and csv files are not copied.
Pawel, just stumbled on your question and:
<Copy SourceFiles="$(MSBuildProjectDirectory)\bin\FROM\.config" DestinationFolder="$(MSBuildProjectDirectory)\BuildOutput\TO\.config"></Copy>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With