jacoco

jacoco coverage per test setup

空扰寡人 提交于 2019-12-04 16:55:52
I'm using jacoco in order to gather code metrics and import them to sonarQube but i was missing details about coverage per test. So after searching about it i came to this tutorial but failed to make it work on my project. here is my pom.xml <properties> <sonarVersion>2.4</sonarVersion> <spring-framework.version>4.0.0.RELEASE</spring-framework.version> <spring-framework.security.version>3.2.5.RELEASE</spring-framework.security.version> <jackson.version>1.9.13</jackson.version> <jacoco.version>0.7.7.201606060606</jacoco.version> <aspectj.version>1.7.4</aspectj.version> <sonar.java

JaCoCo and MR Jars

安稳与你 提交于 2019-12-04 13:23:23
There is an issue with JaCoCo and the MultiRelease JAR files . Since the same class name exist on two places, JaCoCo complains: Caused by: java.lang.IllegalStateException: Can't add different class with same name: jodd/core/JavaBridge at org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:107) at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:96) How we can tell JaCoCo (in Gradle) to skip the classes from META-INF path? OR to behave like it should (use correct class and ignoring other versions), depending on JVM version? igr As explained by @nullpointer,

Sonar Jacoco for Kotlin Setup not generating code coverage

扶醉桌前 提交于 2019-12-04 10:08:09
问题 I'm trying to do Sonar Setup with Jacoco for Kotlin to generate Code Coverage report but it's not showing any code coverage. While checking Sonar Console it showing following error. Anyone has faced this issue before, any suggestion what could be miss. Meta info plugin using sonarqube version "2.6.1" gradleVersion = '3.0.1' kotlinVersion = '1.2.21' Sonarqube version = Version 6.7.1 (build 35068) - LGPL v3 Frustrating part is, my setup project generating blank code coverage report :(. PFA.

How to exclude classes and packages using EclEmma plugin in eclipse

前提是你 提交于 2019-12-04 06:04:25
问题 I have four projects for which i want to skip the code coverage of some classes and packages in some projects, i am using EclEmma plugin in eclipse. I checked in Preferences->Code Coverage , in Excludes section if i give some class files , but still it doesn't get excluded in the code coverage report. Any help will be appreciated. 回答1: Unfortunately currently EclEmma does not support exclusions from the report as stated in https://github.com/jacoco/eclemma/issues/84 (where by the way you

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

女生的网名这么多〃 提交于 2019-12-04 05:31:31
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) Configured the Pinnacle job in Hudson to "invoke standalone Sonar Analysis" with these properties: sonar

jacocoTestReport task not being generated

别等时光非礼了梦想. 提交于 2019-12-04 05:15:05
Android Studio 3.1 Canary 8 Build #AI-173.4529993, built on January 6, 2018 JRE: 1.8.0_152-release-1024-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.14.14-300.fc27.x86_64 I am trying to use the jacoco to generate code coverage. However, when I run the command ./gradlew tasks I don't see any tasks called jacocoTestReport . I get the below error when I try and run the tasks ./gradlew jacocoTestReport : Task 'jacocoTestReport' not found in root project 'EnumSample' This is my build.gradlew file: apply plugin: 'com.android.application' apply plugin: 'jacoco' android {

Cobertura : how to cover spring-data @Repository interfaces

爷,独闯天下 提交于 2019-12-04 03:51:13
Regarding following information : https://stackoverflow.com/a/14601831/704246 Cobertura does not instrument interfaces I'd like to know how to add spring-data interfaces to coverage results, since @Repository implementation classes are only declared and instantiated by Spring at runtime. Consider following interface : // src/main/java/my/package/MyObjectRepository.java @Repository public interface MyObjectRepository { MyObject findMyObjectByCodeAndName(String code, String name); } and following test : // src/test/java/my/package/MyObjectRepositoryTest.java // @RunWith(SpringJUnit4ClassRunner

How to have code coverage in Jenkins with Jacoco and multiple modules?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 03:43:53
问题 My code structure is as follows : events messages other-code functional-tests In the build script for jacoco, first it has to copy all classes and use that class directory to run the tool on. Can you please describe the steps wrt the target directories here. I mean how do I mention the directory on which to run the code coverage upon. Upon build, each folder has its own target folder with classes in side them. Here are the steps: Build project as a job in Jenkins Deploy it to user-stage Run

Plugin with id 'org.sonarqube' not found

浪子不回头ぞ 提交于 2019-12-04 03:20:31
I am trying to implement sonar with gradle for code-coverage measure for my project. we are using gradle-4.0.1 and sonarqube-6.4 . when I run gradle sonarqube from command line I get this error- Plugin with id 'org.sonarqube' not found. I tried few code changes but no luck, please help. My build.gradle file is as below- buildscript { ext { springBootVersion = '1.5.4.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } apply plugin: 'org.sonarqube' apply plugin: "jacoco" apply plugin: "java" apply