Teamcity + Silverlight + dotCover

Hi,

We recently upgraded to Teamcity 6.0 in anticipation of the dotCover integration, but can't seem to figure out if it's possible to make it work with Silverlight unit test projects? Our current setup is to run a msbuild runner which runs the tests using Statlight, but it doesn't look like the msbuild runner supports dotCover.

Any tips for making this work, or is is it something that could come in a future update?

18 comments

Same for us.
If possible, please let us know :)

0

You may call dotcover from you MSBuild script to gather code coverage. Than, use

http://confluence.jetbrains.net/display/TCD6/Manually+Configuring+Reporting+Coverage for details.
0

Could you give a bit more detail as to how you would call dotCover? I've tried getting dotCover to run Silverlight unit tests (StatLight) using the console runner, but not been successful - it only reports coverage on the actual test class and third party assemblies, but not the code under test.

Thanks

Dave

0

Please have a look to related article on integration MSpec .NET cover coverage with dotCover into TeamCity

Do you receive any cove coverage information if start dotCover  with silver light tests under console (without TeamCity)

Please check you sources contains debug information that is required for dotCover to recover statement information in reports.

0

If I run the console runner (outside of TeamCity) with debug binaries, I'm not getting the coverage information I'm expecting. I'm getting the test assembly coverage, and I'm getting assemblies like Accessibility, Ionic.Zip.Reduced, Microsoft.mshtml, Microsoft.VisualStudio.ServiceModelSink - which make me think that maybe dotCover is picking up assemblies from statLight, and not my silverlight Xap file.

This is my xml config file:


<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <Executable>BuildTools\SilverlightTestRunner\StatLight.exe</Executable>
  <Arguments>-x=&quot;Project.UI.Test.xap&quot;</Arguments>
  <WorkingDir>src\Test\Project.UI.Test\Bin\Debug</WorkingDir>
  <Output>output1.xml</Output>
</AnalyseParams>

By the way, the article you mentioned should help once I've got it running in the console runner - thanks!

0

Please have a look at
http://statlight.codeplex.com/documentation

It seems that statlight starts another process to run tests under. Probably this is why you do not see any tests.
Try adding  --webserveronly commandline argument

0

Hello Dave,
Do the assemblies you are interested in have 0% coverage or they are not present in the report at all?

0

I'm in the same situation as Dave here.

I got a lot of "noise" in the report, but I set up filters in the dotCover configuration file to remove all System.*, Statlight.*, etc.

What I'm left with now is coverage report of my test project since I've set up a IncludeFilter to add all assemblies/namespaces starting with our namespace prefix. I would expect to find both my test project AND the assemblies under test located in the report. I know that Statlight successfully run the tests since I see the tests running and all passes, so there are something missing here.

0

After messing about for quite a while with this, I have a feeling that it's not possible. I've looked all over the internet for anything about coverage with StatLight, and not found anything. I think it's probably to do with how StatLight works (and probably most test runners for Silverlight), in that it has to host an internet explorer instance. It looks to me like the modules that dotCover is picking up are actually either Internet Explorer modules, or StatLight modules.

I had assumed that because of the previous posts, it was possible, but I think not.


It would be great if someone could say otherwise.....

I had tried going down a different route of writing tests in the standard .net framework, and linking to the silverlight application, but haven't been successful, but I am a bit surprised that there isn't much guidance from JetBrains about Silverlight coverage, as they mention Silverlight coverage on the main site.

0

This is resolved ?

I am using following

<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <TargetExecutable>
StatLight.exe
  </TargetExecutable>
  <TargetArguments>-x="XAP Path" -webserveronly  --teamcity</TargetArguments>
  <TargetWorkingDir>
  </TargetWorkingDir>
  <TempDir>
    <!-- Directory for the auxiliary files. Set to system temp by default. -->
  </TempDir>
  <Output>G:\outputcoverage\outputcoverage.html</Output>
  <ReportType>
    HTML
  </ReportType>
  <InheritConsole>
    <!-- [True|False] Lets the application being analysed to inherit dotCover console. True by default. -->
  </InheritConsole>
 
  <!-- Coverage filters. It's possible to use asterisks as wildcard symbols.  -->
<Filters>
  <IncludeFilters>
    <FilterEntry>
      <ModuleMask>DLLName.*</ModuleMask>
      <ClassMask>*</ClassMask>
      <FunctionMask>*</FunctionMask>
    </FilterEntry>
  </IncludeFilters>
  <ExcludeFilters>
    <FilterEntry>
      <ModuleMask>Machine.*</ModuleMask>
      <ClassMask>*</ClassMask>
      <FunctionMask>*</FunctionMask>
    </FilterEntry>
    <FilterEntry>
      <ModuleMask>Specs</ModuleMask>
      <ClassMask>*</ClassMask>
      <FunctionMask>*</FunctionMask>
    </FilterEntry>
    <FilterEntry>
      <ModuleMask>mspec</ModuleMask>
      <ClassMask>*</ClassMask>
      <FunctionMask>*</FunctionMask>
    </FilterEntry>
    <FilterEntry>
      <ModuleMask>CommandLine</ModuleMask>
      <ClassMask>*</ClassMask>
      <FunctionMask>*</FunctionMask>
    </FilterEntry>
  </ExcludeFilters>
</Filters>
 
</AnalyseParams>

Above html file always shows "0" coverage .   Can suggestion ?

0

Hello,

Please check statlight starts test process in StatLight.exe, but not in some other process under system.
DotCover is only able to attach to child process of StatLight.exe to collect code coverage.

0

It give message coverage started

[Exec] JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.

[11:52:56][Exec]
[11:53:00][Exec] Coverage session started [20/04/2012 11:53:01]
[11:53:02][Exec]
[11:53:02][Exec] StatLight - Version 1.5.4260
[11:53:02][Exec] Copyright (C) 2009-2011 Jason Jarrett
[11:53:02][Exec] All Rights Reserved.


[11:53:34][[ Project.xap ] Test run results: Total 147, Successful 147, Failed 0,

[11:53:40][Exec] Coverage session finished [20/04/2012 11:53:40]

[11:53:40][Exec] Coverage results post-processing started [20/04/2012 11:53:40]

[11:53:40][Exec] Coverage results post-processing finished [20/04/2012 11:53:40]

[11:53:40][Exec] Report generation started [20/04/2012 11:53:41]

[11:53:41][Exec] Report generation finished [20/04/2012 11:53:41]



but when the actual covergage is always 0. Do you have any sample configuration for doning this ?

Is it really possible to have Silverlight code Coverage ?
0

Hello,

Please take a look to statlight documentation.
http://statlight.codeplex.com/documentation

It shows, statlight execute your silverlight application inside the browser.
You start dotCover in order to gather coverage from the child process.
It turns out, that your application executes on in the process, but on the browser host process.

The issue is that statlight kills browser. dotCover is unable to fetch coverage information if process is killed.
Please vote for http://youtrack.jetbrains.com/issue/DCVR-2290

0

How are my Silverlight tests being covered from the ReSharper Unit Test Explorer? Is it possible to pass the same parameters to dotCover command line? If so, what are those? I really want to get Silverlight unit test assemblies covered in TeamCity 7.1.

0

Thank you for update. Please vote for statlight support issue:
http://youtrack.jetbrains.com/issue/TW-15157

You may also notice, there is a related requirest in dotCover to support statlight tests from console.
http://youtrack.jetbrains.com/issue/DCVR-2290

Please vote for those issues.

0

I had already voted for both of them. DCVR-2290 was created 22 months ago. Will we ever see any updates to it?

My question is, how is it that dotCover and ReSharper appear to be covering my Silverlight unit tests? I don't need to run these through Statlight since it appears to work. What are the parameters that ReSharper passes to dotCover for Silverlight assemblies?

0

Please sign in to leave a comment.