Quantcast

Configuring sonarqube to show unittest and acceptance tests coverage

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Configuring sonarqube to show unittest and acceptance tests coverage

neelanshu_ld
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi all,

I am setting up sonarqube on my local machine for c#.net projects and I am having problems setting up the unittest and acceptance tests coverage.

I am running sonarqube server 5.1 and sonarrunner 2.4

I understand that i need to generate the codecoverage xml first which i do using the following bat file

************************************* file starts*******************
set Configuration=debug
set MSTest=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe
call "C:\Insallations\opencover.4.5.3207\OpenCover.Console.exe" -register:user -target:"%MSTest%" -targetargs:"/resultsfile:[test project name].trx /noisolation /testcontainer:%~dp0[test project fodler name]\bin\%Configuration%\[test project name].dll" -filter:+[test project name]* -output:"%~dp0codecoverageresults.xml"

************************************* file ends*******************

I dont have visualstudio generating a .trx file as specified in the batch file above (resultsfile) though. Does it absolutely have to be there?

It does generate the codecoverageresults.xml file but running sonar-runner later nothing shows up on the server webpage (page which displays details of code analysis)

here is how my properties file look like

************************************* file starts*******************

sonar.projectKey=web-key
sonar.projectVersion=develop
sonar.projectName=web

#info required for sonar
sonar.sources=.
sonar.language=cs
sonar.sourceEncoding=UTF-8

sonar.visualstudio.enable=true

#core c# settings
sonar.dotnet.visualstudio.solution.file=myweb.sln
sonar.dotnet.excludeGeneratedCode=true
sonar.dotnet.4.0.sdk.directory=C:/Windows/Microsoft.NET/Framework64/v4.0.30319
sonar.dotnet.version=4.0

# To prevent any issues while analyzing multiple solutions containing projects with similar keys
# Will be set by default to safe starting at version 2.2: http://jira.codehaus.org/browse/SONARDOTNT-339
sonar.dotnet.key.generation.strategy=safe

#Gendarme
sonar.gendarme.mode=

# Gallio / Unit Tests
sonar.gallio.mode=
sonar.gallio.installDirectory=C:/Program Files (x86)/Gallio
sonar.gallio.coverage.tool=OpenCover
sonar.opencover.installDirectory=C:/Insallations/opencover.4.5.3207/
sonar.dotnet.visualstudio.testProjectPattern=*.Tests;*.UnitTests;*Tests
sonar.cs.opencover.reportPaths=codecoverageresults.xml

sonar.cs.vstest.reportsPaths=
sonar.gallio.runner=Local



# FXCop
sonar.fxcop.mode=skip

# StyleCop
sonar.stylecop.mode=

# Resharper
sonar.resharper.mode=

# NDeps
sonar.ndeps.mode=skip

************************************* file ends*******************
Any help with getting this up and running is hugely appreciated.


Loading...