I'm currently using the sln2008 runner. Is there a way to configure TeamCity to execute MSpec tests without switching to a NAnt or MSBuild runner?
+1
A:
You may use msbuild runner. Please see http://stackoverflow.com/questions/938347/how-to-integrate-mspec-with-ms-build for description on how to integrate msbuild and mspec
Eugene Petrenko
2009-10-19 13:58:05
Thanks Eugene. I came across that answer as well. I was hoping to do it using the sln2008 runner.
Bob Banks
2009-10-19 14:05:49
Feel free to post an issue to tracker at http://youtrack.jetbrains.net
Eugene Petrenko
2009-10-20 16:20:27
A:
I've never done it, but you could probably add a post build Exec task that just shelled out to mspec.exe. Just throw the code from my answer linked to above (http://stackoverflow.com/questions/938347/how-to-integrate-mspec-with-ms-build) in your specs csproj and add DependsOnTargets="RunSpecs" to your AfterBuild target:
<Target Name="RunSpecs">
<PropertyGroup>
<MSpecCommand>
lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll
</MSpecCommand>
</PropertyGroup>
<Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
<Exec Command="$(MSpecCommand)" />
</Target>
<Target Name="AfterBuild" DependsOnTargets="RunSpecs">
</Target>
aaronjensen
2009-12-22 19:25:39
Interesting. I hadn't thought of that. Thanks Aaron! I'll give it a shot.
Bob Banks
2009-12-23 13:18:04
No problem, let me know if it works out. That said, unless you have a very good reason for sticking to the sln2008 runner I'd toss that goal aside and use msbuild or rake (I *much* prefer rake).
aaronjensen
2009-12-27 18:49:51