SonarQube C#
  1. SonarQube C#
  2. SONARCS-258

Implement support for dotcover teamcity coverage xml reports

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      2

      Description

      Please add support for dotcover TeamCity coverage reports, following the discussion in:

      http://sonar.15.n6.nabble.com/Csharp-Use-Case-dotcover-parsing-strategy-td4999148.html#a4999170

      thanks in advance

      Jorge Costa

        Activity

        Hide
        Alexandre Victoor added a comment -

        The key to get usable report is to specify TeamCityXML as the output type:

        dotCover.exe r /Source=SNAPSHOT.report /Output=dotcover.report.xml /ReportType=TeamCityXML
        

        Strangely this report type is not documented...

        Show
        Alexandre Victoor added a comment - The key to get usable report is to specify TeamCityXML as the output type: dotCover.exe r /Source=SNAPSHOT.report /Output=dotcover.report.xml /ReportType=TeamCityXML Strangely this report type is not documented...
        Hide
        Alexandre Victoor added a comment -

        Available in the trunk

        Show
        Alexandre Victoor added a comment - Available in the trunk
        Hide
        Jorge Costa added a comment -

        Just gave it a try and all seems to work except for the source code highlight of uncovered lines. See attachement

        Im using the plugin with sonar 3.1

        10:23:02.512 DEBUG ver22ParsingStrategy - Not using PartCover 2.2 report format2
        10:23:02.512 INFO CoverParsingStrategy - dotCover version 1.2.352.19 format detected
        10:23:02.951 INFO p.PhasesTimeProfiler - Sensor org.sonar.plugins.csharp.gallio.CoverageReportSensor@17db4c43 done: 508 ms

        Show
        Jorge Costa added a comment - Just gave it a try and all seems to work except for the source code highlight of uncovered lines. See attachement Im using the plugin with sonar 3.1 10:23:02.512 DEBUG ver22ParsingStrategy - Not using PartCover 2.2 report format2 10:23:02.512 INFO CoverParsingStrategy - dotCover version 1.2.352.19 format detected 10:23:02.951 INFO p.PhasesTimeProfiler - Sensor org.sonar.plugins.csharp.gallio.CoverageReportSensor@17db4c43 done: 508 ms
        Hide
        Alexandre Victoor added a comment -

        Thanks for your feedback.
        What happens if you click on checkbox "Full Source"?
        Do you get the same behaviour on files covered by unit tests?

        Show
        Alexandre Victoor added a comment - Thanks for your feedback. What happens if you click on checkbox "Full Source"? Do you get the same behaviour on files covered by unit tests?
        Hide
        Jorge Costa added a comment - - edited

        Ok, i know what was the problem. The coverage report was only covering a part of the sources, so only these show up. I guess this is only a limitation of the plugin. If there is no information in the coverage report files than there is no update of this information in the source files. Im not sure if this can be improved somehow at the plugin?

        But as far as the ticket is concerned i can confirm its working

        Show
        Jorge Costa added a comment - - edited Ok, i know what was the problem. The coverage report was only covering a part of the sources, so only these show up. I guess this is only a limitation of the plugin. If there is no information in the coverage report files than there is no update of this information in the source files. Im not sure if this can be improved somehow at the plugin? But as far as the ticket is concerned i can confirm its working
        Hide
        Jorge Costa added a comment -

        Hi,

        So ive now am using this feature with all the builds and sometimes i get this error:

        [15:04:12]org.sonar.api.utils.SonarException: Sourcefile referenced in dotCover report not found
        [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parseFileBloc(DotCoverParsingStrategy.java:105) ~[sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parse(DotCoverParsingStrategy.java:74) ~[sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.CoverageResultParser.parse(CoverageResultParser.java:103) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.parseAndSaveCoverageResults(CoverageReportSensor.java:142) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.analyseUnitCoverage(CoverageReportSensor.java:94) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.analyse(CoverageReportSensor.java:83) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.phases.Phases.execute(Phases.java:93) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:139) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:110) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:111) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.batch.Batch.execute(Batch.java:104) [sonar-batch-3.1.1.jar:na]
        [15:04:12] at org.sonar.runner.Launcher.executeBatch(Launcher.java:65) [sonar-runner.jar:na]
        [15:04:12] at org.sonar.runner.Launcher.execute(Launcher.java:58) [sonar-runner.jar:na]
        [15:04:12] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_04]
        [15:04:12] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at org.sonar.runner.Runner.delegateExecution(Runner.java:186) [sonar-runner.jar:na]
        [15:04:12] at org.sonar.runner.Runner.execute(Runner.java:78) [sonar-runner.jar:na]
        [15:04:12] at org.sonar.runner.Main.main(Main.java:61) [sonar-runner.jar:na]
        [15:04:12]Caused by: java.io.IOException: The device is not ready
        [15:04:12] at java.io.WinNTFileSystem.canonicalize0(Native Method) ~[na:1.7.0_04]
        [15:04:12] at java.io.Win32FileSystem.canonicalize(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at java.io.File.getCanonicalPath(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at java.io.File.getCanonicalFile(Unknown Source) ~[na:1.7.0_04]
        [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parseFileBloc(DotCoverParsingStrategy.java:102) ~[sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na]
        [15:04:12] ... 25 common frames omitted

        This crashs the analysis altogether. Is it possible to ignore this and proceed with other files. Ive attached a patch for this.

        thanks

        Jorge Costa

        Show
        Jorge Costa added a comment - Hi, So ive now am using this feature with all the builds and sometimes i get this error: [15:04:12] org.sonar.api.utils.SonarException: Sourcefile referenced in dotCover report not found [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parseFileBloc(DotCoverParsingStrategy.java:105) ~ [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parse(DotCoverParsingStrategy.java:74) ~ [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.CoverageResultParser.parse(CoverageResultParser.java:103) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.parseAndSaveCoverageResults(CoverageReportSensor.java:142) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.analyseUnitCoverage(CoverageReportSensor.java:94) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.plugins.csharp.gallio.CoverageReportSensor.analyse(CoverageReportSensor.java:83) [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.phases.Phases.execute(Phases.java:93) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:139) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:110) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:111) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.bootstrap.Module.start(Module.java:83) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.batch.Batch.execute(Batch.java:104) [sonar-batch-3.1.1.jar:na] [15:04:12] at org.sonar.runner.Launcher.executeBatch(Launcher.java:65) [sonar-runner.jar:na] [15:04:12] at org.sonar.runner.Launcher.execute(Launcher.java:58) [sonar-runner.jar:na] [15:04:12] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~ [na:1.7.0_04] [15:04:12] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at java.lang.reflect.Method.invoke(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at org.sonar.runner.Runner.delegateExecution(Runner.java:186) [sonar-runner.jar:na] [15:04:12] at org.sonar.runner.Runner.execute(Runner.java:78) [sonar-runner.jar:na] [15:04:12] at org.sonar.runner.Main.main(Main.java:61) [sonar-runner.jar:na] [15:04:12] Caused by: java.io.IOException: The device is not ready [15:04:12] at java.io.WinNTFileSystem.canonicalize0(Native Method) ~ [na:1.7.0_04] [15:04:12] at java.io.Win32FileSystem.canonicalize(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at java.io.File.getCanonicalPath(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at java.io.File.getCanonicalFile(Unknown Source) ~ [na:1.7.0_04] [15:04:12] at org.sonar.plugins.csharp.gallio.results.coverage.DotCoverParsingStrategy.parseFileBloc(DotCoverParsingStrategy.java:102) ~ [sonar-csharp-gallio-plugin-1.4-SNAPSHOT.jar:na] [15:04:12] ... 25 common frames omitted This crashs the analysis altogether. Is it possible to ignore this and proceed with other files. Ive attached a patch for this. thanks Jorge Costa
        Hide
        Jorge Costa added a comment -

        ignore on non referenced file

        Show
        Jorge Costa added a comment - ignore on non referenced file
        Hide
        Fabrice Bellingard added a comment -

        Manually tested, works well.
        Waiting for a license from JetBrains to implement the IT.

        Show
        Fabrice Bellingard added a comment - Manually tested, works well. Waiting for a license from JetBrains to implement the IT.
        Hide
        Fabrice Bellingard added a comment -

        IT added.

        Show
        Fabrice Bellingard added a comment - IT added.

          People

          • Assignee:
            Alexandre Victoor
            Reporter:
            Jorge Costa
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: