Quantcast

Trouble with openCover (no results)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trouble with openCover (no results)

Andrew Krohne
I'm having issues with openCover. On the Sonar dashboard, it shows
that I have 0.0% coverage. My project is in C#, and unit tests are
MSTest format. The test cases themselves run fine (they do all show
that they take 0ms each, but they do run correctly).

For testing, I put Gallio in safe mode, and ran with sonar-runner -X.
sonar-runner is launched as part of a Jenkins build.

10:52:17.040 DEBUG - Coverage report     :
C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\TLA.Core.Tests.dll.coverage-report.xml
10:52:17.040 DEBUG Executing command:
C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe
-register:user -target:C:\Program Files\Gallio\bin\Gallio.Echo.exe
-targetdir:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar
"-targetargs:\"/r:IsolatedAppDomain\"
\"/report-directory:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\"
\"/report-name-format:TLA.Core.Tests.dll.gallio-report\"
\"/report-type:Xml\"
\"C:\Jenkins\workspace\TLACodeLibrary\Main\Source\Libraries\Tests\TLA.Core.Tests\..\..\..\..\Build\Output\Debug\Libraries\Tests\TLA.Core.Tests.dll\""
"-filter:+[TLA.Core]* +[TLA.Communication]* +[TLA.Security]*
+[TLA.Web]* +[TLA.Windows]* +[ConfigCrypter]* +[UDPRebroadcaster]*
+[UDPRebroadcasterConsole]* +[ConfigEditor]* +[TLA.ServiceProcess]*
+[TLA.ServiceModel]* +[TLA.ServiceBus]* +[TCPRebroadcaster]*
+[TCPRebroadcasterConsole]* +[DataMigrationUtility]* " -mergebyhash
-output:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\TLA.Core.Tests.dll.coverage-report.xml

--- snip --

10:52:54.729 INFO  Generating reports.
10:52:55.041 INFO  Disposing the test runner.
10:52:55.047 INFO  Stop time: 10:52 AM (Total execution time: 37.666 seconds)
10:52:55.048 INFO
10:52:55.054 INFO  871 run, 607 passed, 236 failed, 28 inconclusive, 0 skipped
10:52:55.054 INFO
10:52:55.080 INFO  Committing...
10:52:55.200 INFO  No results - no assemblies that matched the
supplied filter were instrumented (missing PDBs?)


There's not much information I can find on this specific error; some
mention of different command line switches, but given that openCover
is launched by sonar, I'm not sure how I'd begin to mess with that. I
double-checked that I was creating a debug build, and the PDB's are in
the same directory. Other than setting it in safe mode (to see one
library at a time, rather than all of them) and running in debug mode,
everything else is configured as installed. I'm running in Windows
Server 2008, x86.

Thanks,
-Andrew

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Trouble with openCover (no results)

Menzies, Neil M
I've had this issue - you need to register the OpenCover profiler library. (see opencover wiki for details)

It *ought* to run OK using the OpenCover -register flag, but Sonar uses -register:user and you can't configure this...

Might be worth raising a Jira for a Sonar option covering the OpenCover register flag.

Neil Menzies

-----Original Message-----
From: Andrew Krohne [mailto:[hidden email]]
Sent: 15 March 2012 11:59
To: [hidden email]
Subject: [sonar-user] Trouble with openCover (no results)

I'm having issues with openCover. On the Sonar dashboard, it shows that I have 0.0% coverage. My project is in C#, and unit tests are MSTest format. The test cases themselves run fine (they do all show that they take 0ms each, but they do run correctly).

For testing, I put Gallio in safe mode, and ran with sonar-runner -X.
sonar-runner is launched as part of a Jenkins build.

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Trouble with openCover (no results)

Alexandre Victoor-2

Indeed please create a jira ticket about this issue !
It should not be too hard to implement ;-)
Regards

Alex

Le 15 mars 2012 13:06, "Menzies, Neil M" <[hidden email]> a écrit :
I've had this issue - you need to register the OpenCover profiler library. (see opencover wiki for details)

It *ought* to run OK using the OpenCover -register flag, but Sonar uses -register:user and you can't configure this...

Might be worth raising a Jira for a Sonar option covering the OpenCover register flag.

Neil Menzies

-----Original Message-----
From: Andrew Krohne [mailto:[hidden email]]
Sent: 15 March 2012 11:59
To: [hidden email]
Subject: [sonar-user] Trouble with openCover (no results)

I'm having issues with openCover. On the Sonar dashboard, it shows that I have 0.0% coverage. My project is in C#, and unit tests are MSTest format. The test cases themselves run fine (they do all show that they take 0ms each, but they do run correctly).

For testing, I put Gallio in safe mode, and ran with sonar-runner -X.
sonar-runner is launched as part of a Jenkins build.

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with openCover (no results)

Andrew Krohne
In reply to this post by Menzies, Neil M
Well, I've registered OpenCover.Profiler.dll, with regsvr32, per the
wiki, and I'm not having the same issue anymore. I am, however, having
a most-likely unrelated issue -- the unit tests never finish. Whereas
before they'd all complete in about 45 seconds, I've had it running
for about a half hour and it's still not done. The last test that did
successfully run gave a 'System.OutOfMemoryException', and that was 10
minutes ago.

Is this related, or is there possibly a bug in my configuration?

For reference, the command is still the same:

C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe
-register:user -target:C:\Program Files\Gallio\bin\Gallio.Echo.exe
-targetdir:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar
"-targetargs:\"/r:IsolatedAppDomain\"
\"/report-directory:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\"
\"/report-name-format:TLA.Core.Tests.dll.gallio-report\"
\"/report-type:Xml\"
\"C:\Jenkins\workspace\TLACodeLibrary\Main\Source\Libraries\Tests\TLA.Core.Tests\..\..\..\..\Build\Output\Debug\Libraries\Tests\TLA.Core.Tests.dll\""
"-filter:+[TLA.Core]* +[TLA.Communication]* +[TLA.Security]*
+[TLA.Web]* +[TLA.Windows]* +[ConfigCrypter]* +[UDPRebroadcaster]*
+[UDPRebroadcasterConsole]* +[ConfigEditor]* +[TLA.ServiceProcess]*
+[TLA.ServiceModel]* +[TLA.ServiceBus]* +[TCPRebroadcaster]*
+[TCPRebroadcasterConsole]* +[DataMigrationUtility]* " -mergebyhash
-output:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\TLA.Core.Tests.dll.coverage-report.xml

Thanks,

-Andrew

On Thu, Mar 15, 2012 at 8:02 AM, Menzies, Neil M
<[hidden email]> wrote:

> I've had this issue - you need to register the OpenCover profiler library. (see opencover wiki for details)
>
> It *ought* to run OK using the OpenCover -register flag, but Sonar uses -register:user and you can't configure this...
>
> Might be worth raising a Jira for a Sonar option covering the OpenCover register flag.
>
> Neil Menzies
>
> -----Original Message-----
> From: Andrew Krohne [mailto:[hidden email]]
> Sent: 15 March 2012 11:59
> To: [hidden email]
> Subject: [sonar-user] Trouble with openCover (no results)
>
> I'm having issues with openCover. On the Sonar dashboard, it shows that I have 0.0% coverage. My project is in C#, and unit tests are MSTest format. The test cases themselves run fine (they do all show that they take 0ms each, but they do run correctly).
>
> For testing, I put Gallio in safe mode, and ran with sonar-runner -X.
> sonar-runner is launched as part of a Jenkins build.
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Trouble with openCover (no results)

Menzies, Neil M
There *was* an issue with OpenCover and MsTest where it would hang instead of exiting, I think it's fixed now - check what version you're running.

Neil

-----Original Message-----
From: Andrew Krohne [mailto:[hidden email]]
Sent: 15 March 2012 14:10
To: [hidden email]
Subject: Re: [sonar-user] Trouble with openCover (no results)

Well, I've registered OpenCover.Profiler.dll, with regsvr32, per the wiki, and I'm not having the same issue anymore. I am, however, having a most-likely unrelated issue -- the unit tests never finish. Whereas before they'd all complete in about 45 seconds, I've had it running for about a half hour and it's still not done. The last test that did successfully run gave a 'System.OutOfMemoryException', and that was 10 minutes ago.

Is this related, or is there possibly a bug in my configuration?

For reference, the command is still the same:

C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe
-register:user -target:C:\Program Files\Gallio\bin\Gallio.Echo.exe -targetdir:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar
"-targetargs:\"/r:IsolatedAppDomain\"
\"/report-directory:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\"
\"/report-name-format:TLA.Core.Tests.dll.gallio-report\"
\"/report-type:Xml\"
\"C:\Jenkins\workspace\TLACodeLibrary\Main\Source\Libraries\Tests\TLA.Core.Tests\..\..\..\..\Build\Output\Debug\Libraries\Tests\TLA.Core.Tests.dll\""
"-filter:+[TLA.Core]* +[TLA.Communication]* +[TLA.Security]*
+[TLA.Web]* +[TLA.Windows]* +[ConfigCrypter]* +[UDPRebroadcaster]*
+[UDPRebroadcasterConsole]* +[ConfigEditor]* +[TLA.ServiceProcess]*
+[TLA.ServiceModel]* +[TLA.ServiceBus]* +[TCPRebroadcaster]*
+[TCPRebroadcasterConsole]* +[DataMigrationUtility]* " -mergebyhash
-output:C:\Jenkins\workspace\TLACodeLibrary\Main\Source\.sonar\TLA.Core.Tests.dll.coverage-report.xml

Thanks,

-Andrew

On Thu, Mar 15, 2012 at 8:02 AM, Menzies, Neil M <[hidden email]> wrote:

> I've had this issue - you need to register the OpenCover profiler
> library. (see opencover wiki for details)
>
> It *ought* to run OK using the OpenCover -register flag, but Sonar uses -register:user and you can't configure this...
>
> Might be worth raising a Jira for a Sonar option covering the OpenCover register flag.
>
> Neil Menzies
>
> -----Original Message-----
> From: Andrew Krohne [mailto:[hidden email]]
> Sent: 15 March 2012 11:59
> To: [hidden email]
> Subject: [sonar-user] Trouble with openCover (no results)
>
> I'm having issues with openCover. On the Sonar dashboard, it shows that I have 0.0% coverage. My project is in C#, and unit tests are MSTest format. The test cases themselves run fine (they do all show that they take 0ms each, but they do run correctly).
>
> For testing, I put Gallio in safe mode, and ran with sonar-runner -X.
> sonar-runner is launched as part of a Jenkins build.
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of securities,
> accuracy and completeness of information, viruses, confidentiality,
> legal privilege, and legal entity disclaimers, available at
> http://www.jpmorgan.com/pages/disclosures/email.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Trouble with openCover (no results)

hquezada
This post has NOT been accepted by the mailing list yet.
In reply to this post by Alexandre Victoor-2
Does anyone know if this jira ticket was ever created?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trouble with openCover (no results)

Schmeiser
This post was updated on .
In reply to this post by Andrew Krohne
Based on my experience with OpenCover, I would suggest you to try the following:

1. Run test with Debug build. OpenCover might be messing up with your IL code while instrumenting/profiling.
2. Check your filter if there's any executable assembly and skip it. OpenCover sometimes mess up when trying to profile several running processes. Guessing only by names, based on your command line there are several candidates: [TLA.ServiceProcess]*, +[TCPRebroadcasterConsole]*.  To achieve this go to Sonar's setting page and find 'Coverage excludes' under .NET Gallio.
3. Try running in isolated process instead of isolated app domain:
sonar.gallio.runner=IsolatedProcess

Also, I'd advise you to check the OpenCover's manual (Usage.rtf, goes with the tool)
Good luck
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Trouble with openCover (no results)

hquezada
This post has NOT been accepted by the mailing list yet.
In reply to this post by Menzies, Neil M
i ran this command and the code coverage works. But the next day the code coverage was not working. So i ran the command again and then the code coverage works again. Did  you have run the command everytime?
Loading...