4

What is the best way to run silverlight unit tests automatically using team city?

I have found StatLight which we had working well when we used cc.net, and it says that it has support for teamcity. Does this just mean the test results output file is compatible with teamcity? Do I need to create a command line runner to run the tests? If so how do I get the test results into team city?

Thanks

Tom
  • 623
  • 8
  • 23
  • Would you mind packaging up your CC.Net artifacts used to view StatLight results? (statlight.codeplex.com - patches)? Thanks - Jason – Jason Jarrett Mar 24 '10 at 14:13
  • When I say we go it working in CC.Net, I mean we got cc.net to run a Nant task which ran StatLight and output the results in xml. CC.Net then merged the results xml into the build log and we created an xsl style sheet to display the results in the success email. Are you basically suggesting packaging this combination of info, config settings and style sheet and submitting as a patch to StatLight? – Tom Mar 24 '10 at 14:30
  • Yes - I'd love to have your style sheet & work on a how-to in the wiki for StatLight to tell others how to get it running under CC.Net. – Jason Jarrett Mar 24 '10 at 14:50

3 Answers3

4

TeamCity has an extensibility feature where you can output special commands to the console and the TeamCity agent will capture the commands and publish the results within TeamCity.

If you get StatLight running on your desktop - do a regular console-run. Then do another run by giving it the "--teamcity" parameter. Notice the difference in the output?

In TeamCity you can setup a Command Line Build Runner

Command executable: "<Path to statlight.exe>"

Command parameters: "-x=%system.teamcity.build.checkoutDir%\PathToXap\SilverlightClient.Tests.xap --teamcity"

Hope this helps.

Jason Jarrett
  • 3,857
  • 1
  • 27
  • 28
  • Awesome. Thanks. That has made things clearer. I'll give this a go as soon as we get the build building again :) – Tom Mar 24 '10 at 14:25
1

There's also a StatLight TeamCity plugin that adds a test runner.

jrummell
  • 42,637
  • 17
  • 112
  • 171
0

You can try using Lighthouse Silverlight Unit Test Runner, it works with every Build Server including TeamCity and CCNet because it by default produces NUnit compatible xml results file:

http://lighthouse.codeplex.com/

Roboblob
  • 1,795
  • 1
  • 22
  • 27