archived-codacy / coverage-parser Goto Github PK
View Code? Open in Web Editor NEWLibrary for parsing coverage reports
Library for parsing coverage reports
Add support for OpenCover based on this repository
Hi codacy-coverage-reporter
team,
I was wondering if there was a ready solution to reporting of a pitest
-format (mutation-based test coverage).
Maven 3
plugin 1.1.0
Windows 10
Use uname -a
if on Linux.
1.8.0.161
Paste the output from java -version
at the command line.
If this is an issue that involves integration with another system, include the exact version and OS of the other system, including any intermediate drivers or APIs i.e. if you connect to a PostgreSQL database, include both the version / OS of PostgreSQL and the JDBC driver version used to connect to the database.
Upload report
Please describe the expected behavior of the issue, starting from the first action.
1.Run coverage phase
2.
3.
Build Failure due to / by zero error
Please provide a description of what actually happens, working from the same starting point.
Be descriptive: "it doesn't work" does not describe what the behavior actually is -- instead, say "when sending the coverage with the command (...) it returns the output error (...)"
Please provide a some information on how to reproduce the bug. A PR with a failing test would be awesome, if possible.
StackTrace:
`[INFO] Parsing coverage data... \target\site\jacoco\jacoco.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.979 s
[INFO] Finished at: 2019-02-08T13:01:28+10:00
[INFO] Final Memory: 14M/179M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gavinmogan:codacy-maven-plugin:1.1.0:coverage (default-cli) on project Minigames: Execution default-cli of goal com.gavinmogan:codacy-maven-plugin:1.1.0:coverage failed: / by zero -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.gavinmogan:codacy-maven-plugin:1.1.0:coverage (default-cli) on project Minigames: Execution default-cli of goal com.gavinmogan:codacy-maven-plugin:1.1.0:coverage failed: / by zero
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.gavinmogan:codacy-maven-plugin:1.1.0:coverage failed: / by zero
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 21 more
Caused by: java.lang.ArithmeticException: / by zero
at com.codacy.parsers.implementation.JacocoParser.com$codacy$parsers$implementation$JacocoParser$$lineCoverage(JacocoParser.scala:47)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5$$anonfun$apply$1.apply(JacocoParser.scala:32)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5$$anonfun$apply$1.apply(JacocoParser.scala:30)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5.apply(JacocoParser.scala:29)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5.apply(JacocoParser.scala:27)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at com.codacy.parsers.implementation.JacocoParser.generateReport(JacocoParser.scala:26)
at com.gavinmogan.CodacyCoverageReporterMojo.processReport(CodacyCoverageReporterMojo.java:221)
at com.gavinmogan.CodacyCoverageReporterMojo.execute(CodacyCoverageReporterMojo.java:136)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 22 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
`
Add support to clover xml reports. Merging the functionality of php-codacy-coverage into this tool.
Add support to PHPUnit coverage xml reports. Merging the functionality of php-codacy-coverage into this tool.
Any help much appreciated, better code coverage reporting equals a sweeter smelling garden
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:34 min
[INFO] Finished at: 2019-02-15T21:17:24+00:00
[INFO] Final Memory: 89M/1143M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gavinmogan:codacy-maven-plugin:1.0.3:coverage (post-test) on project backend: Execution post-test of goal com.gavinmogan:codacy-maven-plugin:1.0.3:coverage failed: / by zero -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.gavinmogan:codacy-maven-plugin:1.0.3:coverage (post-test) on project backend: Execution post-test of goal com.gavinmogan:codacy-maven-plugin:1.0.3:coverage failed: / by zero
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution post-test of goal com.gavinmogan:codacy-maven-plugin:1.0.3:coverage failed: / by zero
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.ArithmeticException: / by zero
at com.codacy.parsers.implementation.JacocoParser.com$codacy$parsers$implementation$JacocoParser$$lineCoverage(JacocoParser.scala:47)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5$$anonfun$apply$1.apply(JacocoParser.scala:32)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5$$anonfun$apply$1.apply(JacocoParser.scala:30)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5.apply(JacocoParser.scala:29)
at com.codacy.parsers.implementation.JacocoParser$$anonfun$5.apply(JacocoParser.scala:27)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at com.codacy.parsers.implementation.JacocoParser.generateReport(JacocoParser.scala:26)
at com.gavinmogan.CodacyCoverageReporterMojo.processReport(CodacyCoverageReporterMojo.java:196)
at com.gavinmogan.CodacyCoverageReporterMojo.execute(CodacyCoverageReporterMojo.java:121)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Some snippets from the pom.xml I'm using
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
And using the supported codacy maven plugin
<plugin>
<groupId>com.gavinmogan</groupId>
<artifactId>codacy-maven-plugin</artifactId>
<version>1.0.3</version>
<configuration>
<apiToken>${codacy.api.key}</apiToken>
<projectToken>${codacy.project.key}</projectToken>
<coverageReportFile>${project.build.directory}/site/jacoco/jacoco.xml</coverageReportFile>
<!--<commit>${env.TRAVIS_COMMIT}</commit>-->
<codacyApiBaseUrl>https://api.codacy.com</codacyApiBaseUrl>
<failOnMissingReportFile>true</failOnMissingReportFile>
</configuration>
<executions>
<execution>
<id>post-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>coverage</goal>
</goals>
</execution>
</executions>
</plugin>
See attached jacoco.xml file that causes the fail.
Documentation: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
It seems that if a reportFile is empty, all current parser implementations fail, originating a Left(s"no parser for $language")
error message.
Empty reports could be filtered so that the tool could provide a more informative error response
Deepcode reached out to us to partner with Codacy - request and information bellow:
https://docs.google.com/document/d/18BlMgC7tBBnkHkwDoS28j4kivrk1oAOgN8aEzej47f0/edit?ts=5e6fbe9c#heading=h.jm8dn3v1ylny
The goal of this task is too investigate if this would work with our Client side tools system and add details to the document above.
Support for some new coverage report formats were added.
Update the repository documentation to represent these formats, which tools generate them, and which languages can be tested using said tools.
This tool should be able to replace the tool located at https://github.com/codacy/csharp-codacy-coverage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.