jacoco

“No information about coverage per test.” from Sonar with Jacoco Ant build

不羁的心 提交于 2019-12-06 20:30:59
问题 I'm using Ant, Jacoco and Sonar. When I run my build Sonar tells me that "No information about coverage per test." and the Sonar dashboard has my coverage results, but I cannot drill down into them to see the code. However, the HTML report generated by Jacoco does include drill down into the code. This is my coverage task: <jacoco:coverage destfile="${coverage.output.file}" > <junit printsummary="on" errorProperty="test.failed" failureProperty="test.failed" haltonfailure="yes" fork="true">

How to exclude Dagger2 classes from test coverage

人盡茶涼 提交于 2019-12-06 17:15:56
问题 Is there any option to exclude Dagger2 classes from test coverage report in Android Studio 回答1: JaCoCo excludes If you're using JaCoCo, for example using android instrumentation connected tests , you need to configure the excludes (or includes), which, according to the documentation is... A list of class files to exclude from the report. May use wildcard characters (* and ?). When not specified nothing will be excluded. Which means you need to match the generated dagger class names. The

JaCoCo with microservice project architecture?

一笑奈何 提交于 2019-12-06 16:09:10
My project consists of 6 microservices in java and I am trying to figure out how to merge the html reports from Jacoco into one overall coverage report. As it stands now I end up with a report for each service and it would be nice to have an aggregated one so I can more easily put it into our CI for visibility etc. I've tried various things I've found on web searches, but I end up with an empty coverage file when I try those suggestions. Here is my gradle file: subprojects { apply plugin: 'jacoco' jacoco { toolVersion = "0.7+" reportsDir = file("$buildDir/reports/customJacocoReportDir") }

Jacoco code coverage show 0% coverage on Jenkins

久未见 提交于 2019-12-06 13:50:15
问题 I have read most of the answers available for similar questions but none of those fit to answer my question. My profile in pom file looks like this: <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.7.201606060606</version> <executions> <!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven the Surefire plugin is executed. --> <execution> <id>pre-unit-test</id> <goals> <goal>prepare

Missing jacoco.exec file when using jacoco offline instrumentation with Powermock

末鹿安然 提交于 2019-12-06 11:47:31
问题 Despite apparently this post showed a solution to using powermock and jacoco, I haven't been able to make it work in a pretty simple project (available on GitHub). In my case, the test executes correctly but the jacoco.exec file is missing so jacoco doesn't check coverage. Test class: @RunWith(PowerMockRunner.class) @PrepareOnlyThisForTest(Util.class) @PowerMockIgnore("org.jacoco.agent.rt.*") public class UtilTest { @Test public void testSay() throws Exception { PowerMockito.mockStatic(Util

Jacoco and Sonar code coverage?

故事扮演 提交于 2019-12-06 09:39:10
问题 Using : JaCoCo 0.5.3, Maven2, Sonar 2.14, sonar-maven-plugin 1.8, SùartGWT 3.0 Currently trying to : Get code coverage on Sonar of my Selenium unit tests. Problem : Code coverage doesn't move from 0% although the sensor is launched properly, analyse the jacoco.exec which is correctly generated. Ressources : https://gist.github.com/2888912 The pom.xml It's been about 2 weeks I'm trying to get code coverage. I upgraded the Sonar from 2.10 to 2.14, changed every single sonar property, tried the

SonarQube does not collect code coverage

…衆ロ難τιáo~ 提交于 2019-12-06 08:42:59
问题 I have a problem to set up gradle with sonar-runner and jacoco. Everything works great excepting code coverage. I have tried everything without results. Here is my build.gradle file: apply from: './dependencies.gradle' def langLevel = 1.8 allprojects { apply plugin: 'idea' apply plugin: 'eclipse' group 'pl.lodz.uml.sonda' version '1.0.0' } subprojects { apply plugin: 'java' apply plugin: 'sonar-runner' apply plugin: 'jacoco' compileJava.options.encoding = 'UTF-8' sourceCompatibility =

0% code coverage on espresso tests with JaCoCo and Gradle

假如想象 提交于 2019-12-06 01:39:16
问题 In my JaCoCo code coverage reports for my espresso tests, all lines and branches are missed. I am using JaCoCo in an Android application which is built with gradle 1.5.0. My gradle configuration: apply plugin: 'jacoco' android { buildTypes { debug { testCoverageEnabled = true } } } jacoco { version '0.7.5.201505241946' } I followed this blog post: Test coverage report for Android application. When I run createDebugCoverageReport , the report is generated in the correct folder (build/reports

“Project coverage is set to 0%” – JaCoCo and Sonar in Jenkins with Ant

…衆ロ難τιáo~ 提交于 2019-12-06 01:27:01
问题 I moved my job from a single Hudson machine to a multi-slave Jenkins environment, and now JaCoCo coverage no longer works. WORKING (old): Hudson 2.0.1, Jenkins Sonar Plugin 1.7.1, Sonar 2.1.2 BROKEN (new): Jenkins 1.446, Jenkins Sonar Plugin 1.7.2, Sonar 2.1.2 My Hudson job is called Pinnacle and it used to run on a single Hudson server with Sonar on the same machine. I set up my (NO MAVEN) build by doing the following. 1) Added an Ant target to my build.xml called test-with-coverage 2)

Maven结合SonarQube的使用笔记

社会主义新天地 提交于 2019-12-06 00:35:01
前提: 1,SonarQube已经安装好且已经安装了sonar-php-plugin,并且在测试服务器上也安装并配置好了sonar-scanner 2,安装了Maven 这个非常简单,直接从官网上下载Maven的zip包,解开然后配置下面这个配置文件即可 export MAVEN_HOME=/usr/local/maven333 export PATH=$MAVEN_HOME/bin:$PATH 一,Maven简单项目 配置pom.xml,使之产生Junit单元测试报告 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <skip>false</skip> <!--<reportsDirectory>${project.basedir}/target/junit</reportsDirectory> --> </configuration> </plugin> </plugins> </build> 默认就是产生在target目录下面的surefire-reports目录里