Sonarqube未收到代码覆盖率结果

时间:2017-07-26 13:54:12

标签: c# sonarqube opencover

我已按照此doc进行了代码覆盖。

我可以将代码覆盖率结果作为xml。但它没有显示在sonarqube仪表板上。

MSBuild.exe begin /k:"Xamarin-Template" /n:"Xamarin-Template" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="PATH\Coverage.xml” 

Build

OpenCover.Console.exe -output:Coverage.xml -register:Administrator -target:nunit.consolerunner\3.7.0\tools\nunit3-console.exe -targetargs:PATH\bin\Debug\UnitTest.dll

MSBuild.exe end

以下是错误日志

11:13:49.823 DEBUG: Initializers : 
11:13:49.824 INFO: Base dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\XamarinBasePT.Core
11:13:49.824 INFO: Working dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\out\.sonar\mod0
11:13:49.827 INFO: Source paths: App.cs, Properties/AssemblyInfo.cs, AlertMessage/ActionSheet.cs, AlertMessage/AlertMessage.cs, AlertMessage/IActionSheet.cs, AlertMessage/IAlertMessage.cs, Data/UserDetailDatabase.cs, FileManager/FileManager.cs, FileManager/IFileHelper.cs, FileManager/IFileManager.cs, Models/UserDetail.cs, Reachability/IReachability.cs, Reachability/NetworkStatus.cs, Utility/DateTimeExtension.cs, Utility/StringExtension.cs, Webservice/WebserviceHelper.cs, packages.config
11:13:49.828 INFO: Test paths: bin/Debug
11:13:49.828 INFO: Source encoding: UTF-8, default locale: en_US
11:13:49.828 INFO: Index files
11:13:49.834 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
11:13:49.834 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:13:49.834 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:13:49.838 DEBUG: Language of file 'Properties/AssemblyInfo.cs' is detected to be 'cs'
11:13:49.838 DEBUG: Language of file 'App.cs' is detected to be 'cs'
11:13:49.839 DEBUG: Language of file 'AlertMessage/ActionSheet.cs' is detected to be 'cs'
11:13:49.863 INFO: Analyzer working directory contains 5 .pb file(s)
11:13:49.890 DEBUG: Language of file 'AlertMessage/AlertMessage.cs' is detected to be 'cs'
11:13:49.891 DEBUG: Language of file 'AlertMessage/IActionSheet.cs' is detected to be 'cs'
11:13:49.892 DEBUG: Language of file 'AlertMessage/IAlertMessage.cs' is detected to be 'cs'
11:13:49.893 DEBUG: Language of file 'Data/UserDetailDatabase.cs' is detected to be 'cs'
11:13:49.895 DEBUG: Language of file 'FileManager/FileManager.cs' is detected to be 'cs'
11:13:49.895 DEBUG: Language of file 'FileManager/IFileHelper.cs' is detected to be 'cs'
11:13:49.895 DEBUG: Language of file 'FileManager/IFileManager.cs' is detected to be 'cs'
11:13:49.896 DEBUG: Language of file 'Models/UserDetail.cs' is detected to be 'cs'
11:13:49.896 DEBUG: Language of file 'Reachability/IReachability.cs' is detected to be 'cs'
11:13:49.897 DEBUG: Language of file 'Reachability/NetworkStatus.cs' is detected to be 'cs'
11:13:49.897 DEBUG: Language of file 'Utility/DateTimeExtension.cs' is detected to be 'cs'
11:13:49.897 DEBUG: Language of file 'Utility/StringExtension.cs' is detected to be 'cs'
11:13:49.901 DEBUG: Language of file 'Webservice/WebserviceHelper.cs' is detected to be 'cs'
11:13:49.906 INFO: 16 files indexed
11:13:49.910 INFO: Quality profile for cs: Sonar way
11:13:49.978 DEBUG: Code colorizer, supported languages: 
11:13:50.382 DEBUG: 'SmellMeasuresSensor' skipped because there is no related file in current project
11:13:50.382 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
11:13:50.382 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:13:50.382 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:13:50.382 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
11:13:50.383 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
11:13:50.383 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:13:50.387 DEBUG: Sensors : Lines Sensor (wrapped) -> SCM Sensor (wrapped) -> C# (wrapped) -> C# Unit Tests Coverage Report Import (wrapped) -> C# Integration Tests Coverage Report Import (wrapped) -> C# Unit Test Results Import (wrapped) -> SonarJavaXmlFileSensor (wrapped) -> Zero Coverage Sensor (wrapped) -> Code Colorizer Sensor (wrapped) -> CPD Block Indexer (wrapped)
11:13:50.388 INFO: Sensor Lines Sensor (wrapped)
11:13:50.399 INFO: Sensor Lines Sensor (wrapped) (done) | time=11ms
11:13:50.399 INFO: Sensor SCM Sensor (wrapped)
11:13:50.412 INFO: Sensor SCM Sensor (wrapped) (done) | time=13ms
11:13:50.412 INFO: Sensor C# (wrapped)
11:13:50.417 INFO: Importing analysis results from C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\out\XamarinBasePT.Core_7702\output-cs
11:13:50.600 INFO: Importing Roslyn report
11:13:50.700 INFO: Sensor C# (wrapped) (done) | time=288ms
11:13:50.700 INFO: Sensor C# Unit Tests Coverage Report Import (wrapped)
11:13:50.703 INFO: Sensor C# Unit Tests Coverage Report Import (wrapped) (done) | time=3ms
11:13:50.703 INFO: Sensor C# Integration Tests Coverage Report Import (wrapped)
11:13:50.703 DEBUG: No coverage property. Skip Sensor
11:13:50.703 INFO: Sensor C# Integration Tests Coverage Report Import (wrapped) (done) | time=0ms
11:13:50.703 INFO: Sensor C# Unit Test Results Import (wrapped)
11:13:50.703 DEBUG: No unit test results property. Skip Sensor
11:13:50.703 INFO: Sensor C# Unit Test Results Import (wrapped) (done) | time=0ms
11:13:50.703 INFO: Sensor SonarJavaXmlFileSensor (wrapped)
11:13:50.704 INFO: Sensor SonarJavaXmlFileSensor (wrapped) (done) | time=0ms
11:13:50.704 INFO: Sensor Zero Coverage Sensor (wrapped)
11:13:50.725 INFO: Sensor Zero Coverage Sensor (wrapped) (done) | time=21ms
11:13:50.725 INFO: Sensor Code Colorizer Sensor (wrapped)
11:13:50.726 INFO: Sensor Code Colorizer Sensor (wrapped) (done) | time=1ms
11:13:50.726 INFO: Sensor CPD Block Indexer (wrapped)
11:13:50.726 INFO: DefaultCpdBlockIndexer is used for cs
11:13:50.726 DEBUG: No CpdMapping for language cs
11:13:50.726 INFO: Sensor CPD Block Indexer (wrapped) (done) | time=0ms
11:13:50.727 INFO: -------------  Scan XamarinBasePT.UnitTest
11:13:50.740 INFO: Language is forced to cs
11:13:50.746 DEBUG: Initializers : 
11:13:50.746 INFO: Base dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\XamarinBasePT.UnitTest
11:13:50.746 INFO: Working dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\out\.sonar\mod1
11:13:50.746 INFO: Test paths: DateTimeExtensionTest.cs, StringExtensionTest.cs, packages.config
11:13:50.746 INFO: Source encoding: UTF-8, default locale: en_US
11:13:50.746 INFO: Index files
11:13:50.747 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
11:13:50.747 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:13:50.747 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:13:50.748 DEBUG: Language of file 'DateTimeExtensionTest.cs' is detected to be 'cs'
11:13:50.750 DEBUG: Language of file 'StringExtensionTest.cs' is detected to be 'cs'
11:13:50.751 INFO: 2 files indexed
11:13:50.751 INFO: Quality profile for cs: Sonar way
11:13:50.770 DEBUG: 'SmellMeasuresSensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
11:13:50.771 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:13:50.772 DEBUG: Sensors : Lines Sensor (wrapped) -> SCM Sensor (wrapped) -> C# (wrapped) -> C# Unit Tests Coverage Report Import (wrapped) -> C# Integration Tests Coverage Report Import (wrapped) -> C# Unit Test Results Import (wrapped) -> SonarJavaXmlFileSensor (wrapped) -> Zero Coverage Sensor (wrapped) -> Code Colorizer Sensor (wrapped) -> CPD Block Indexer (wrapped)
11:13:50.772 INFO: Sensor Lines Sensor (wrapped)
11:13:50.772 INFO: Sensor Lines Sensor (wrapped) (done) | time=0ms
11:13:50.772 INFO: Sensor SCM Sensor (wrapped)
11:13:50.779 INFO: Sensor SCM Sensor (wrapped) (done) | time=7ms
11:13:50.781 INFO: Sensor C# (wrapped)
11:13:50.781 DEBUG: No files to analyze. Skip Sensor.
11:13:50.781 INFO: Sensor C# (wrapped) (done) | time=0ms
11:13:50.781 INFO: Sensor C# Unit Tests Coverage Report Import (wrapped)
11:13:50.782 INFO: Sensor C# Unit Tests Coverage Report Import (wrapped) (done) | time=1ms
11:13:50.782 INFO: Sensor C# Integration Tests Coverage Report Import (wrapped)
11:13:50.782 DEBUG: No coverage property. Skip Sensor
11:13:50.782 INFO: Sensor C# Integration Tests Coverage Report Import (wrapped) (done) | time=0ms
11:13:50.782 INFO: Sensor C# Unit Test Results Import (wrapped)
11:13:50.782 DEBUG: No unit test results property. Skip Sensor
11:13:50.782 INFO: Sensor C# Unit Test Results Import (wrapped) (done) | time=0ms
11:13:50.782 INFO: Sensor SonarJavaXmlFileSensor (wrapped)
11:13:50.782 INFO: Sensor SonarJavaXmlFileSensor (wrapped) (done) | time=0ms
11:13:50.783 INFO: Sensor Zero Coverage Sensor (wrapped)
11:13:50.783 INFO: Sensor Zero Coverage Sensor (wrapped) (done) | time=0ms
11:13:50.783 INFO: Sensor Code Colorizer Sensor (wrapped)
11:13:50.783 INFO: Sensor Code Colorizer Sensor (wrapped) (done) | time=0ms
11:13:50.783 INFO: Sensor CPD Block Indexer (wrapped)
11:13:50.783 INFO: DefaultCpdBlockIndexer is used for cs
11:13:50.784 DEBUG: No CpdMapping for language cs
11:13:50.784 INFO: Sensor CPD Block Indexer (wrapped) (done) | time=1ms
11:13:50.784 INFO: -------------  Scan Xamarin-Template
11:13:50.796 INFO: Language is forced to cs
11:13:50.800 DEBUG: Initializers : 
11:13:50.800 INFO: Base dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate
11:13:50.801 INFO: Working dir: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\out\.sonar
11:13:50.801 INFO: Source encoding: UTF-8, default locale: en_US
11:13:50.801 INFO: Quality profile for cs: Sonar way
11:13:50.820 DEBUG: 'SmellMeasuresSensor' skipped because there is no related file in current project
11:13:50.820 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
11:13:50.820 DEBUG: 'C#' skipped because there is no related file in current project
11:13:50.820 DEBUG: 'C# Unit Tests Coverage Report Import' skipped because there is no related file in current project
11:13:50.820 DEBUG: 'C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
11:13:50.820 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:13:50.821 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:13:50.821 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
11:13:50.821 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
11:13:50.821 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:13:50.822 DEBUG: Sensors : Lines Sensor (wrapped) -> SCM Sensor (wrapped) -> C# Unit Test Results Import (wrapped) -> SonarJavaXmlFileSensor (wrapped) -> Zero Coverage Sensor (wrapped) -> Code Colorizer Sensor (wrapped) -> CPD Block Indexer (wrapped)
11:13:50.822 INFO: Sensor Lines Sensor (wrapped)
11:13:50.822 INFO: Sensor Lines Sensor (wrapped) (done) | time=0ms
11:13:50.822 INFO: Sensor SCM Sensor (wrapped)
11:13:50.822 INFO: Sensor SCM Sensor (wrapped) (done) | time=0ms
11:13:50.822 INFO: Sensor C# Unit Test Results Import (wrapped)
11:13:50.822 DEBUG: No unit test results property. Skip Sensor
11:13:50.822 INFO: Sensor C# Unit Test Results Import (wrapped) (done) | time=0ms
11:13:50.823 INFO: Sensor SonarJavaXmlFileSensor (wrapped)
11:13:50.823 INFO: Sensor SonarJavaXmlFileSensor (wrapped) (done) | time=0ms
11:13:50.823 INFO: Sensor Zero Coverage Sensor (wrapped)
11:13:50.823 INFO: Sensor Zero Coverage Sensor (wrapped) (done) | time=0ms
11:13:50.823 INFO: Sensor Code Colorizer Sensor (wrapped)
11:13:50.823 INFO: Sensor Code Colorizer Sensor (wrapped) (done) | time=0ms
11:13:50.823 INFO: Sensor CPD Block Indexer (wrapped)
11:13:50.824 INFO: DefaultCpdBlockIndexer is used for cs
11:13:50.824 DEBUG: No CpdMapping for language cs
11:13:50.824 INFO: Sensor CPD Block Indexer (wrapped) (done) | time=1ms
11:13:50.827 INFO: Calculating CPD for 11 files
11:13:50.828 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Data/UserDetailDatabase.cs
11:13:50.834 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Models/UserDetail.cs
11:13:50.834 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Utility/DateTimeExtension.cs
11:13:50.835 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Utility/StringExtension.cs
11:13:50.836 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:App.cs
11:13:50.837 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Properties/AssemblyInfo.cs
11:13:50.837 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Webservice/WebserviceHelper.cs
11:13:50.838 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Reachability/IReachability.cs
11:13:50.839 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:FileManager/FileManager.cs
11:13:50.840 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:Reachability/NetworkStatus.cs
11:13:50.841 DEBUG: Detection of duplications for com.hcl.XamarinProjectTemplate:com.hcl.XamarinProjectTemplate:278A214F-DFA6-4333-9DE7-56C4F7D61A86:AlertMessage/AlertMessage.cs
11:13:50.841 INFO: CPD calculation finished
11:13:51.247 INFO: Analysis report generated in 397ms, dir size=77 KB
11:13:51.308 INFO: Analysis reports compressed in 61ms, zip size=47 KB
11:13:51.308 INFO: Analysis report generated in C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\out\.sonar\batch-report
11:13:51.308 DEBUG: Upload report

请帮我解决此问题。我错过了什么吗?

  

结果(nunit3)保存为TestResult.xml提交...已访问的类   4/15(26.67)访问方法25 of 55(45.45)访问点170   300(56.67)访问分支29 of 79(36.71)

     

====替代结果(包括所有方法,包括那些没有相应来源的方法)====替代访问类4 of 19(21.05)   替代访问方法27 of 84(32.14)

0 个答案:

没有答案