jacoco

android jacoco coverage shows 0% with gradle however there are 95% tests covering code

烈酒焚心 提交于 2019-12-20 04:50:49
问题 I'm trying to get jacoco create a code coverage report for my android test project. Gradle version classpath 'com.android.tools.build:gradle:2.0.0' I have the following in build.gradle: apply plugin: 'com.android.application' apply plugin: 'jacoco' jacoco { toolVersion = "0.7.1.201405082137" } android { buildTypes { release { } debug { testCoverageEnabled true } } } It shows report as below image There is almost 95% of the code coverage (When I ran the same report in 2015 it showed the report

Jacoco Test coverage report shows 0%

大兔子大兔子 提交于 2019-12-20 03:24:36
问题 I have to get the code coverage of a application while business test are executed from a different code base. I use: Maven as my build Jbehave as my testing framework. The test are written in java. My application is a set of war files deployed on tomcat. The application code base is separate from test code base. In getting the coverage I followed the below steps. 1 Compile the test code using maven. 2 Copy application classes from the place it was build (${app.code.dir}/target/classes) to $

Gradle jacoco code coverage - Then publish/show in Jenkins

杀马特。学长 韩版系。学妹 提交于 2019-12-19 11:34:24
问题 I'm trying to setup code coverage for a Java application project. Project name : NewApp Project structure: src/java/** (source code) src/java-test (unit tests - Jnuit) test/it-test (integration test) test/at-tests (acceptance tests) tomcat/* (contain tomcat start/stop scripts) xx/.. etc folders which are required for a usual application. Gradle version : 1.6 Environment : Linux I have a running gradle build script that fetches application (NewApp) dependencies (i.e. service jars used by the

Merging Android unit test and connected test code coverage data is broken

断了今生、忘了曾经 提交于 2019-12-19 10:29:41
问题 Version 2.3.3 of the Android Gradle Plugin was able to provide merged unit test and connected test code coverage data. In version 3.0.0, this capability is broken because each of the test types use a different and incompatible version of JaCoCo. Rafael Toledo provided a Medium blog post showing how to make this work with 2.3.3. I have provided a Github repo that illustrates the working code and the broken code in a few branches. The repo documentation provides a Readers Digest description of

Unit tests coverage using Jacoco for test classes written using Powermock

一曲冷凌霜 提交于 2019-12-19 04:14:48
问题 I am trying to get the code coverage report on the sonarqube dashboard on jenkins. The code coverage report is coming up but showing only 4.6% coverage. On investigating I found out that the test classes written using PowerMocks are getting skipped. On further investigation I found that "JaCoCo doesn't play well with dynamically modified/created classes (this is the way how powermock works). This is a known limitation we can't currently do anything about". Is there any work around for this so

Gradle jacoco coverage report with more than one submodule(s)?

蓝咒 提交于 2019-12-19 03:25:21
问题 Does anybody know how to configure a gradle file for java jacoco report that contain codecoverage of more than one gradle submodule? my current approach only shows codecoverage of the current submodule but not codecoverage of a sibling-submodul. I have this project structure - build.gradle (1) - corelib/ - build.gradle (2) - src/main/java/package/Core.java - extlib/ - build.gradle (3) - src/main/java/package/Ext.java - src/test/java/package/Integrationtest.java when i execute gradlew :extlib

SonarQube - integrationTest.exec - sonarRunner (Gradle) or “sonar-runner” command - showing 0.0% covereage

有些话、适合烂在心里 提交于 2019-12-19 03:15:22
问题 I'm successfully generating 2 .exec files by Jacoco within "build/jacoco" folder after running a Gradle based build and integration tests. Gradle command: "gradle clean build integrationTest" Once done, it generates the following .exec files under build/jacoco folder. test.exec integrationTest.exec Following is my sonar-project.properties file. When, I run "sonar-runner" from Linux prompt it completes but on SonarQube dashboard for this project, I see Unit test says some 34.5% but integration

Android测试配置的文件(Robolectric+jacoco)

試著忘記壹切 提交于 2019-12-18 10:40:46
1、使用Robolectric (1)在app\build.gradle里面配置 testImplementation "org.robolectric:robolectric:3.8" testImplementation 'org.robolectric:shadows-support-v4:3.4-rc2' testImplementation 'org.robolectric:shadows-multidex:3.0' (2)在"...\xxxProject\build.gradle"中添加 repositories{ ... maven { url 'https://maven.google.com' } // Robolectric下载所需 } 2、使用数据库ObjectBox (1)在app\build.gradle里面配置 apply plugin: 'io.objectbox' implementation "io.objectbox:objectbox-android:${OBJECTBOX_VERSION}" implementation "io.objectbox:objectbox-linux:${OBJECTBOX_VERSION}" implementation "io.objectbox:objectbox-macos:$OBJECTBOX

Maven JaCoCo plugin error

喜你入骨 提交于 2019-12-17 18:09:26
问题 I have configured the Maven JaCoCo plugin as follows in my pom.xml file: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <jacoco.version>0.5.9.201207300726</jacoco.version> </properties> <profiles> <profile> <id>jacoco4</id> <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>${jacoco.version}</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> <configuration <destfile>$

Minimum code coverage threshold in Jacoco Gradle

假如想象 提交于 2019-12-17 16:15:37
问题 How can I set the minimum code coverage in Jacoco Gradle? I want the build to fail if it is not met. 回答1: The feature is now available. You simply need to apply the Gradle JaCoCo plugin and define coverage verification like this: apply plugin: 'jacoco' jacocoTestCoverageVerification { violationRules { rule { limit { minimum = 0.7 } } } } // to run coverage verification during the build (and fail when appropriate) check.dependsOn jacocoTestCoverageVerification The last line is very important