Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1141

Refresh Clover-for-Scala prototype

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Tasks:

            [CLOV-1141] Refresh Clover-for-Scala prototype

            it is compiler plugins with three runners (SBT, Gradle and Maven). In case of SBT it copies test in Test and runs as test in Scoverage (sbt scoverage:test) but all setup is shared. It then creates two xml reports, one compatible with Cobertura, exactly this is DOCTYPE: http://cobertura.sourceforge.net/xml/coverage-04.dtd - and other one with its own syntax. This is part of scoverage.xml from project with almost no tests that we work on now:

            <scoverage 
            statement-count="1379" statements-invoked="152" statement-rate="11,02" branch-rate="6,63" version="1.0" timestamp="1405633646344">
                <packages>
                    <package name="com.specdevs.specgine.animation" statement-count="119" statements-invoked="9" statement-rate="7,56">
                        <classes>
                            <class 
                            name="TweenId" filename="/animation/TweenId.scala" statement-count="1" statements-invoked="0" statement-rate="0,00" branch-rate="100,00">
                                <methods>
                                    <method 
                                    name="com.specdevs.specgine.animation/TweenId/&lt;none&gt;" statement-count="1" statements-invoked="0" statement-rate="0,00" branch-rate="100,00">
                                        <statements>
                                            <statement 
                                            package="com.specdevs.specgine.animation" class="TweenId" method="&lt;none&gt;" start="598" line="19" symbol="com.specdevs.specgine.animation.TweenId.&lt;init&gt;" tree="Apply" branch="false" invocation-count="0">
            </statement>
                                        </statements>
            </method>
                                </methods>
            </class>
            

            and same in cobertura syntax:

            <?xml version="1.0"?>
            <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
            <coverage line-rate="11,02" lines-covered="1379" lines-valid="152" branches-covered="166" branches-valid="11" branch-rate="6,63" complexity="0" version="1.0" timestamp="1405633645883">
                  <sources>
                    <source>/src/main/scala</source>
                  </sources>
                  <packages>
                    <package name="com.specdevs.specgine.animation" line-rate="7,56" branch-rate="8,33" complexity="0">
                  <classes>
                    <class name="TweenId" filename="src/main/scala/animation/TweenId.scala" line-rate="0,00" branch-rate="100,00" complexity="0">
                  <methods>
                    <method name="com.specdevs.specgine.animation/TweenId/&lt;none&gt;" signature="()V" line-rate="0,00" branch-rate="100,00">
                  <lines>
                    <line number="19" hits="0" branch="false"/>
                  </lines>
                </method>
                  </methods>
                  <lines>
                    <line number="19" hits="0" branch="false"/>
                  </lines>
                </class>
            

            Andrzej Giniewicz added a comment - it is compiler plugins with three runners (SBT, Gradle and Maven). In case of SBT it copies test in Test and runs as test in Scoverage (sbt scoverage:test) but all setup is shared. It then creates two xml reports, one compatible with Cobertura, exactly this is DOCTYPE: http://cobertura.sourceforge.net/xml/coverage-04.dtd - and other one with its own syntax. This is part of scoverage.xml from project with almost no tests that we work on now: <scoverage statement-count= "1379" statements-invoked= "152" statement-rate= "11,02" branch-rate= "6,63" version= "1.0" timestamp= "1405633646344" > <packages> <package name= "com.specdevs.specgine.animation" statement-count= "119" statements-invoked= "9" statement-rate= "7,56" > <classes> <class name= "TweenId" filename= "/animation/TweenId.scala" statement-count= "1" statements-invoked= "0" statement-rate= "0,00" branch-rate= "100,00" > <methods> <method name= "com.specdevs.specgine.animation/TweenId/&lt;none&gt;" statement-count= "1" statements-invoked= "0" statement-rate= "0,00" branch-rate= "100,00" > <statements> <statement package= "com.specdevs.specgine.animation" class= "TweenId" method= "&lt;none&gt;" start= "598" line= "19" symbol= "com.specdevs.specgine.animation.TweenId.&lt;init&gt;" tree= "Apply" branch= "false" invocation-count= "0" > </statement> </statements> </method> </methods> </class> and same in cobertura syntax: <?xml version= "1.0" ?> <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd" > <coverage line-rate= "11,02" lines-covered= "1379" lines-valid= "152" branches-covered= "166" branches-valid= "11" branch-rate= "6,63" complexity= "0" version= "1.0" timestamp= "1405633645883" > <sources> <source> /src/main/scala </source> </sources> <packages> <package name= "com.specdevs.specgine.animation" line-rate= "7,56" branch-rate= "8,33" complexity= "0" > <classes> <class name= "TweenId" filename= "src/main/scala/animation/TweenId.scala" line-rate= "0,00" branch-rate= "100,00" complexity= "0" > <methods> <method name= "com.specdevs.specgine.animation/TweenId/&lt;none&gt;" signature= "()V" line-rate= "0,00" branch-rate= "100,00" > <lines> <line number= "19" hits= "0" branch= "false" /> </lines> </method> </methods> <lines> <line number= "19" hits= "0" branch= "false" /> </lines> </class>

            How does this tool work by the way? Does it create some database during compilation (like the clover.db)? Does it produce coverage recording files when executed? I didn't have time to look into its sources...

            Marek Parfianowicz added a comment - How does this tool work by the way? Does it create some database during compilation (like the clover.db)? Does it produce coverage recording files when executed? I didn't have time to look into its sources...

            I'm glad it can help.

            I currently use it for my project, turning it on was very easy (had no luck with SCCT earlier due to complicated project setup) and it even works for my macros subpackage. In my opinion it has only 2 flaws: no way to merge reports from subprojects into one report ( https://github.com/scoverage/sbt-scoverage/issues/13 ), and crashe of coverage gathering when macro bundles are used ( https://github.com/scoverage/scalac-scoverage-plugin/issues/43 ). Other than that it works perfectly for most uses.

            Also outside of Scoverage, hurting all coverage gathering solutions for Scala, there is https://github.com/scoverage/sbt-scoverage#wheres-the-pretty-output-gone - but for my project it did not occured and colour output worked normally in Scala 2.11.1.

            Andrzej Giniewicz added a comment - I'm glad it can help. I currently use it for my project, turning it on was very easy (had no luck with SCCT earlier due to complicated project setup) and it even works for my macros subpackage. In my opinion it has only 2 flaws: no way to merge reports from subprojects into one report ( https://github.com/scoverage/sbt-scoverage/issues/13 ), and crashe of coverage gathering when macro bundles are used ( https://github.com/scoverage/scalac-scoverage-plugin/issues/43 ). Other than that it works perfectly for most uses. Also outside of Scoverage, hurting all coverage gathering solutions for Scala, there is https://github.com/scoverage/sbt-scoverage#wheres-the-pretty-output-gone - but for my project it did not occured and colour output worked normally in Scala 2.11.1.

            Thanks a lot for a link. Indeed, it's an interesting tool and as it's based on the Apache 2.0 license, it should be possible to integrate it with Clover.

            Marek Parfianowicz added a comment - Thanks a lot for a link. Indeed, it's an interesting tool and as it's based on the Apache 2.0 license, it should be possible to integrate it with Clover.

            I'm really waiting to see this. I don't know if it can help, but there is also http://scoverage.org/

            Andrzej Giniewicz added a comment - I'm really waiting to see this. I don't know if it can help, but there is also http://scoverage.org/

            Marek Parfianowicz added a comment - See also http://mtkopone.github.io/scct/

              Unassigned Unassigned
              mparfianowicz Marek Parfianowicz
              Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 40h
                  40h
                  Remaining:
                  Remaining Estimate - 40h
                  40h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified