- Checkout a TeamCity plugin build for StatLight -
Download Thanks to @WMMac
TeamCity has an extensibility that allows you to communicate to the server through the console (std out) with special commands. The TeamCity agent will capture the commands and publish the results within TeamCity.
If you first get StatLight console running on your desktop and do a regular test run. Then do another run by giving it the "--teamcity" parameter. Notice the difference in the output?
You can then create a Command Line Build Runner in TeamCity
Command executable: "<Path to statlight.exe>"
Command parameters: "-x=%system.teamcity.build.checkoutDir%\PathToXap\SilverlightClient.Tests.xap --teamcity"
The following blog has a more thorough set of setup steps.
Running Silverlight unit tests in TeamCity using StatLight
If you'r using the latest (Silverligh 4 build) of the Microsoft Silverlight Testing framework and run into an error like the one blow...
Unhandled Exception: System.InvalidOperationException: Showing a modal dialog box or form when the application
is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly
style to display a notification from a service application.
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
You will have to change your TeamCity Agent service to run under the "System" account and check the "Allow service to interact with desktop".
So far - I haven't found a better way around this... (I know it's not ideal)