Gallio + PartCover C# plugin unit test failing

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Gallio + PartCover C# plugin unit test failing

Guru
This post was updated on .
Hi,

I am using the sonar sever version sonar-2.13.1 and sonar-runner-1.1 with C# plugins 1.0.

using the C# plugin for Sonar to run automated unit test on my code, but it's not working. when i executes it says 0 run, 0 passed, 0 failed, 0 inconclusive, 0 skipped.  Below is the sample log for the same, and also i have attached the detailed log also for reference.

17:22:49.034 INFO  open driver pipe
17:22:49.035 INFO  modify target environment variables
17:22:49.035 INFO  create target process
17:22:49.039 INFO  wait for driver connection
17:22:49.508 INFO  
17:22:49.512 INFO  Gallio Echo - Version 3.4 build 11
17:22:49.513 INFO  Get the latest version at http://www.gallio.org/
17:22:49.513 INFO  
17:22:49.571 INFO  Start time: 5:22 PM
17:22:49.582 INFO  Initializing the runtime and loading plugins.
17:22:49.960 INFO  Verifying test files.
17:22:50.025 INFO  Initializing the test runner.
17:22:50.042 INFO  Running the tests.
17:22:55.956 INFO  Generating reports.
17:22:56.226 INFO  Disposing the test runner.
17:22:56.228 INFO  Stop time: 5:22 PM (Total execution time: 6.672 seconds)
17:22:56.229 INFO  
17:22:56.237 INFO  0 run, 0 passed, 0 failed, 0 inconclusive, 0 skipped
17:22:56.238 INFO  
17:22:57.428 INFO  Sensor org.sonar.plugins.csharp.gallio.GallioSensor@62f98b99 done: 8536 ms
17:22:57.428 INFO  Sensor org.sonar.plugins.csharp.stylecop.StyleCopSensor@47a4fd1...
17:22:57.629 INFO  StyleCop install folder not found: 'C:\Program Files\Microsoft StyleCop 4.4.0.14'. The embedded version (4.4.0.14) will be used instead.

I have ran the sonar runner with debug mode using -X option.  This way i  get the command lines used to launch gallio and partcover.

i have taken out the command and run in command line it's working fine without any issues by adding some double quotes for path contains the space.

but while running form sonar-runnar it's not working.

Note: in some post i read for those who are getting similar problem, the solution was to set sonar.gallio.runner to IsolatedProcess.  i have tried with that option as well but it didn't worked well for me. however event i set the sonar.gallio.runner to IsolatedProcess in sonar.properties file still in the log i am seeing default value only of 17:22:48.898 DEBUG - Runner              : IsolatedAppDomain no idea why it's not taking the value from properties file.

i am attaching the log and gallio report file for reference.

gallio-report.xmltestlog.txt

Any help is appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Alexandre Victoor-2
Hello
I do not see any attached file to your previous post, could you send them to us.
Often the problem comes from an incompatibility between gallio and the test framwork used in the solution. You can check out the troubleshooting wiki page if you have not done it already: http://docs.codehaus.org/display/SONAR/C%23+Plugins+Troubleshooting

About the sonar.gallio.runner property not taken in account, do you have somewhere an old "maven style" gallio.runner property? Could you send us your config files?
Regards

Alex




On Tue, Apr 9, 2013 at 2:13 PM, Guru <[hidden email]> wrote:
Hi,

I am using the sonar sever version sonar-2.13.1 and sonar-runner-1.1 with C#
plugins 1.0.

using the C# plugin for Sonar to run automated unit test on my code was not
working when i execute the it says 0 run, 0 passed, 0 failed, 0
inconclusive, 0 skipped below is the sample log for the same. i have
attached the detailed log also for your reference.
gallio-report.xml
<http://sonar.15.x6.nabble.com/file/n5011048/gallio-report.xml>
17:22:49.034 INFO  open driver pipe testlog.txt
<http://sonar.15.x6.nabble.com/file/n5011048/testlog.txt>
17:22:49.035 INFO  modify target environment variables
17:22:49.035 INFO  create target process
17:22:49.039 INFO  wait for driver connection
17:22:49.508 INFO
17:22:49.512 INFO  Gallio Echo - Version 3.4 build 11
17:22:49.513 INFO  Get the latest version at http://www.gallio.org/
17:22:49.513 INFO
17:22:49.571 INFO  Start time: 5:22 PM
17:22:49.582 INFO  Initializing the runtime and loading plugins.
17:22:49.960 INFO  Verifying test files.
17:22:50.025 INFO  Initializing the test runner.
17:22:50.042 INFO  Running the tests.
17:22:55.956 INFO  Generating reports.
17:22:56.226 INFO  Disposing the test runner.
17:22:56.228 INFO  Stop time: 5:22 PM (Total execution time: 6.672 seconds)
17:22:56.229 INFO
17:22:56.237 INFO  0 run, 0 passed, 0 failed, 0 inconclusive, 0 skipped
17:22:56.238 INFO
17:22:57.428 INFO  Sensor
org.sonar.plugins.csharp.gallio.GallioSensor@62f98b99 done: 8536 ms
17:22:57.428 INFO  Sensor
org.sonar.plugins.csharp.stylecop.StyleCopSensor@47a4fd1...
17:22:57.629 INFO  StyleCop install folder not found: 'C:\Program
Files\Microsoft StyleCop 4.4.0.14'. The embedded version (4.4.0.14) will be
used instead.

I have ran the sonar runner with debug mode using -X option.  This way i
get the command lines used to launch gallio and partcover.

i have taken out the command and run in command line it's working fine
without any issues by adding some double quotes for path contains the space.

but while running form sonar-runnar it's not working.

Note: in some post i read for those who are getting similar problem, the
solution was to set sonar.gallio.runner to IsolatedProcess.  i have tried
with that option as well but it didn't worked well for me. however event i
set the sonar.gallio.runner to IsolatedProcess in sonar.properties file
still in the log i am seeing default value only of *17:22:48.898 DEBUG -
Runner              : IsolatedAppDomain* no idea why it's not taking the
value from properties file.

i am attaching the log and gallio report file for reference.

Any help is appreciated!




--
View this message in context: http://sonar.15.x6.nabble.com/Gallio-PartCover-C-plugin-unit-test-failing-tp5011048.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Guru
This post was updated on .
Hi Alex,

Thanks for you response.

i have been visited the wiki page which you have suggested, i did't see any incompatibility between gallio and the test framework on my solution and config files.

Here is the attachments for log and report file.

testlog.txt     gallio-report.xml

i am very new to sonar, not getting you exactly which config file you are looking for(can you please let me know the file name will find and let you know)

in-between i have searched the gallio runner on my sonar sever folder. i got the below file.(C:\Sonar\sonar-2.13.1\war\sonar-server\deploy\plugins\csharpgallio\META-INF\lib\gallio-runner-1.0.jar)

does this help?  Do let me know if you have any problem in accessing my log and report file.

by looking the code in GallioCommandBuilder.java file / version 1.0
the DEFAULT_GALLIO_RUNNER is set to "IsolatedProcess" but when we have the value for coverageTool it's resetting with "IsolatedAppDomain"

below is the code senipet for the same.

 String runner = DEFAULT_GALLIO_RUNNER;
    if (coverageTool != null) {
      LOG.debug("- Coverage tool       : {}", coverageTool.getName());
      runner = coverageTool.getGallioRunner();
    }
    LOG.debug("- Runner              : {}", runner);
    gallioArguments.add("/r:" + runner);

thanks & Regards,
Gurumoorthy S
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Alexandre Victoor-2
Hello
I forgot an obvious advice. You should replace partcover by opencover. Opencover is a rewrite of partcover and in many situations works better.
Your solution seems to be a test solution, if there is no confidential issues, could you post a zip of the sources?
With partcover, since you are using a 64 bits system, you need to use coreflag... Using opencover might be simpler.
Regards

Alex


On Wed, Apr 10, 2013 at 11:38 AM, Guru <[hidden email]> wrote:
Hi Alex,

Thanks for you response.

i have been visited the wiki page which you have suggested, i did't see any
incompatibility between gallio and the test framework on my solution and
config files.

Here is the attachments for log and report file.

testlog.txt <http://sonar.15.x6.nabble.com/file/n5011101/testlog.txt>
gallio-report.xml
<http://sonar.15.x6.nabble.com/file/n5011101/gallio-report.xml>

i am very new to sonar, not getting you exactly which config file you are
looking for(can you please let me know the file name will find and let you
know)

in-between i have searched the gallio runner on my sonar sever folder. i got
the below
file.(C:\Sonar\sonar-2.13.1\war\sonar-server\deploy\plugins\csharpgallio\META-INF\lib\gallio-runner-1.0.jar)

does this help?  Do let me know if you have any problem in accessing my log
and report file.

by looking the code in GallioCommandBuilder.java file / version 1.0
the DEFAULT_GALLIO_RUNNER is set to "IsolatedProcess" but when we have the
value for coverageTool it's resetting with "IsolatedAppDomain"

below is the code senipet for the same.

 String runner = DEFAULT_GALLIO_RUNNER;
    if (coverageTool != null) {
      LOG.debug("- Coverage tool       : {}", coverageTool.getName());
      runner = coverageTool.getGallioRunner();
    }
    LOG.debug("- Runner              : {}", runner);
    gallioArguments.add("/r:" + runner);

thanks & Regards,
Gurumoorthy S



--
View this message in context: http://sonar.15.x6.nabble.com/Gallio-PartCover-C-plugin-unit-test-failing-tp5011048p5011101.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Guru
This post was updated on .
Hi Alex,

here is the source code  SonarTestSolution_(2).zip

will wait for your response.. when i ran the gallio alone without partcover it's working fine.

i am interested to know the reason why it's not working with partcover.

i have tired with opencover still not working ...here the the log message what i am getting...

18:36:12.902 DEBUG Locking the C# Resource Bridge and the Sonar Index: future modifications won't be possible.
18:36:12.902 INFO  Sensor com.sonar.plugins.csharp.squid.C@30144342 done: 284 ms
18:36:12.902 INFO  Sensor org.sonar.plugins.csharp.gallio.GallioSensor@54bb02da...
18:36:12.908 WARN  Tried to get a CoverageTool with name OpenCover, but such a tool is not supported.
18:36:12.908 DEBUG Executing Gallio program...
18:36:12.911 DEBUG - Gallio executable   : C:\Program Files\Gallio\bin\Gallio.Echo.exe
18:36:12.912 DEBUG - Runner              : IsolatedProcess
18:36:12.912 DEBUG - Report directory    : C:\Users\testusr\Documents\visual studio 2010\Projects\SonarTestSolution\.sonar
18:36:12.912 DEBUG - Report file         : gallio-report
18:36:12.912 DEBUG - Test assemblies     :
18:36:12.912 DEBUG    o C:\Users\testusr\Documents\visual studio

i believe the sonar version which i am using  will support only PartCover,NCover

i am unable to download the soanr C# 1.3 version plugin from  http://docs.codehaus.org/pages/viewpage.action?pageId=229742093&navigatingVersions=true# any idea how i can download?
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Alexandre Victoor-2
Hello
Sorry for the delay, I am pretty busy these days. 
About hte code snipset you send your right, with (old) version 1.0 runner parameter was not supported.
This has been added with version 1.1 as stated in the documentation (*).
I have tried your solution on my PC. There is still an issue related to mstest testconfig files and Gallio. Gallio does not allow to use testconfig files and so neither sonar .net ...
Unless you are stuck with mstest, my advice would be to switch to a test framework such as mbunit or nunit. 
Hope it helps

Alex






On Sat, Apr 13, 2013 at 12:04 PM, Guru <[hidden email]> wrote:
Hi Alex,

here is the source code   SonarTestSolution_(2).zip
<http://sonar.15.x6.nabble.com/file/n5011318/SonarTestSolution_%282%29.zip>

will wait for your response i am interested to know the reason why it's not
working with partcover. mean while i will try the opencover. should i need
to install any opencover on my local box?



--
View this message in context: http://sonar.15.x6.nabble.com/Gallio-PartCover-C-plugin-unit-test-failing-tp5011048p5011318.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Guru
Hi Alex,

thanks for your response. it's working fine for me after updating the C# plugin version from 1.0 to 1.3. i have tested with both PartCover and OpenCover and running without any error. But, there are minor difference in the Code Coverage % result.

For the same Code, Where in PartCover gives me 2.2% and OpenCover gives me 5.5%. Do you have any idea, why this difference is?
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Guru
In reply to this post by Alexandre Victoor-2
Can you please guide me how to use MbUnit and Nunit tools in sonar. Which version of the C# plugin need to use?
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Alexandre Victoor-2
Hello
Sorry again for the delay. It is not really a surprise that partcover & opencover do not give exactly the same value. If you want an explanation, you can ask one to the developer of opencover who maintained partcover in the past: https://github.com/sawilde
About mbunit/nunit, you need to install a recent version of gallio and use one of the test framework that is embedded.
Hope it helps

Alex


On Fri, May 3, 2013 at 1:21 PM, Guru <[hidden email]> wrote:
Can you please guide me how to use MbUnit and Nunit tools in sonar. Which
version of the C# plugin need to use?



--
View this message in context: http://sonar.15.x6.nabble.com/Gallio-PartCover-C-plugin-unit-test-failing-tp5011048p5012144.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Guru
I have a latest version of "GallioBundle-3.4.14.0-Setup-x64.msi" setup and installed on my machine. How do i need to test the mbunit/nunit with sonar integration. i am expecting sonar commands which needs to be configure in .properties file.

where in i have tried with this
sonar.gallio.coverage.tool=MbUnit
getting below error. any help would be greatly appreciated.
[exec] 11:21:32.235 ERROR Tried to get a CoverageTool with name MbUnit, but such a tool is not supported.
Reply | Threaded
Open this post in threaded view
|

Re: Gallio + PartCover C# plugin unit test failing

Alexandre Victoor-2
Hello
MbUnit is not a coverage tool. It is a test framework.  
Gallio will automatically detect if you are using mbunit, nunit or something else.
You also need a coverage tool. We recommend OpenCover (https://github.com/sawilde/opencover) which is so far the best open source coverage tool for .net.
Hope it helps

Alex 



On Wed, May 8, 2013 at 8:07 AM, Guru <[hidden email]> wrote:
I have a latest version of "GallioBundle-3.4.14.0-Setup-x64.msi" setup and
installed on my machine. How do i need to test the mbunit/nunit with sonar
integration. i am expecting sonar commands which needs to be configure in
.properties file.

where in i have tried with this
sonar.gallio.coverage.tool=MbUnit
getting below error. any help would be greatly appreciated.
[exec] 11:21:32.235 ERROR Tried to get a CoverageTool with name MbUnit, but
such a tool is not supported.



--
View this message in context: http://sonar.15.x6.nabble.com/Gallio-PartCover-C-plugin-unit-test-failing-tp5011048p5012255.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email