jacoco

Android instrumentation tests for library module coverage

落爺英雄遲暮 提交于 2020-01-01 03:09:16
问题 I inherited an android project to setup code coverage for. Not having done much for android and almost as little in gradle, I embarked on a quest to find a helpful tutorial. As surprises go, the first few tutorials were very helpful and I was able to include the jacoco gradle plugin and enable the code coverage. Using jenkins I even generated a coverage report. So far everything looks fine. However, upon setting my eyes on the report, I smelled something fishy. The test vs coverage ratio

Jacoco code coverage in Android Studio with flavors

微笑、不失礼 提交于 2019-12-31 12:24:07
问题 I've been trying to run Jacoco test coverage for quiet some time now. I've tried several possible solutions reported in these topics: Android test code coverage with JaCoCo Gradle plugin How do I get a jacoco coverage report using Android gradle plugin 0.10.0 or higher? Im running the tests in a emulatated device using genymotion. Here is what i added to build.gradle: apply plugin: 'jacoco' android{ jacoco { version "0.7.1.201405082137" } buildTypes{ debug{ testCoverageEnabled = true } } }

How to add JaCoCo in maven

若如初见. 提交于 2019-12-31 02:08:09
问题 I have written a unit test case using JUnit now I want to add JaCoCo in my build tool that is moving 3.2.1.I am new to Maven. While adding it, I have to doubt that I want to add it in the dependency or plugin ? There are both are available,such that is following <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.2-SNAPSHOT</version> </plugin> <dependency> <groupId>org.codehaus.sonar.plugins</groupId> <artifactId>sonar-jacoco-plugin</artifactId>

Jacoco Maven Plugin - Plugin execution not covered by lifecycle configuration

旧城冷巷雨未停 提交于 2019-12-30 05:38:11
问题 I'm new to Maven and want to use the Jacoco Maven Plugin to build my projects. I've set up an example project with TestNG the only dependency. Here is part of the pom.xml: <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.8</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.6.2.201302030002</version> <executions> <execution> <goals> <goal

Exclude packages from Jacoco report using Sonarrunner and Gradle

雨燕双飞 提交于 2019-12-29 08:33:09
问题 Is there a way to exclude packages from SonarQube(instrumented by gradle + sonar-runner) coverage reports(generated by jacoco) without excluding them completely from the project ? Below is what i tried so far: Version information SonarQube 4.5.1 Gradle 2.2. Jacoco configuration // JaCoCo test coverage configuration tasks.withType(Test) { task -> jacoco { append = false // excluded classes from coverage defined in above configuration excludes = excludedClasses() } jacocoTestReport { doFirst {

Code coverage of JBoss AS 7 testsuite, using JaCoCo - no data in jacoco.exec files

梦想与她 提交于 2019-12-29 08:16:16
问题 I'm trying to get coverage of JBoss AS 7. Here's my branch: https://github.com/OndraZizka/jboss-as/tree/TS-jacoco When I run mvn clean install -rf testsuite -DallTests -Dcoverage -fae I get (almost) empty jacoco.exec files - just some metadata (size is few bytes). The JVM arg line used is: -javaagent:${jbossas.ts.dir}/target/jacoco-jars/agent/jacocoagent.jar=destfile=${basedir}/target/jacoco.exec,includes=${jboss.home}/modules/**/*,excludes=${basedir}/target/classes/**/*,append=true,output

What are the differences between the three methods of code coverage analysis?

一笑奈何 提交于 2019-12-29 03:37:13
问题 This sonar page basically lists the various methods employed by different code coverage analysis tools: Source code instrumentation (Used by Clover) Offline byte code instrumentation (Used by Cobertura) On-the-fly byte code instrumentation (Used by Jacoco) What are these three methods and which one is the most efficient and why?If the answer to the question of efficiency is "it depends" , then please explain why? 回答1: Source code instrumentation consists in adding instructions to the source

JaCoCo returning 0% Coverage with Kotlin and Android 3.0

别说谁变了你拦得住时间么 提交于 2019-12-29 03:33:06
问题 I am trying to check my code coverage for a test case that I wrote in Kotlin. When I execute ./gradlew createDebugCoverageReport --info , my coverage.ec file is empty and my reports indicate that I have 0% coverage. Please note, the test cases are 100% successful. Can anyone think of any reasons my coverage.ec file keeps returning 0 bytes? I have searched everywhere with no luck. apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply

Have integration tests in jacoco-it directory

隐身守侯 提交于 2019-12-25 17:21:31
问题 I have integration tests and they are executed fine, but Jacoco considers them as unit tests. How to tell Jacoco to see them as integration tests and display their graph coverage, not in the jacoco-ut directory, but it the jacoco-it directory ? Here in the Maven configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <configuration> <argLine>${surefireArgLine}</argLine> <excludes> <exclude>**/it/java/*.java<

Why is Gradle / / Sonar Jacoco looking for dir and also project?

戏子无情 提交于 2019-12-25 08:47:31
问题 Background: We have two subprojects each with many sub-sub-projects. The root project is an empty parent. We have one project that is strictly for the flyway plugin. Often times names do not match directories. For perspective, settings.gradle is 219 lines and roughly half of those are projects. So I'm getting this error: Caused by: java.lang.IllegalStateException: The base directory of the module ':commons:sitewidget' does not exist: /dev/abc/commons/:commons:sitewidget Here is the question: