jacoco

false code coverage reported using GwtMockito

孤街浪徒 提交于 2019-12-11 23:19:53
问题 Is there any reason why EclEmma(JaCoCo based) in Eclipse falsely reports the code coverage while using the GwtMockitoTestRunner ? Looking at it's source code, it does install it's own class loader and does byte code manipulation using the Javassist library . Could this affect the code coverage tool anyhow? 回答1: It looks like the issue is that EclEmma/JaCoCo doesn't work well with final methods and with native methods(GWT JSNI code). Fixing these methods everything returned to normal, the

Jacoco 0.8.2 and Android Gradle plugin 3.2.0 test coverage

为君一笑 提交于 2019-12-11 18:18:34
问题 I just tracked down an issue I'm having with partial coverage reports due to Android Gradle plugin 3.2.0 Jacoco is only generating coverage reports for less than 10% of my project. If I revert back to 3.1.4, it behaves as expected. Is there any known issue with AGP 3.2.+ and JaCoCo test coverage? 回答1: In absence of Minimal, Complete, and Verifiable example that demonstrates steps to reproduce your difficulty, one can only guess. Simple search in bugtracker of Android Gradle Plugin by word

How to force code coverage to Zero?

元气小坏坏 提交于 2019-12-11 16:38:32
问题 I have several java projects with no unit test cases. When I try to analyse these projects using SonarQube I am unable to get unit test code coverage because it doesn't have any test cases. As per my research I saw that I can force it to show it as zero if there are no unit test cases. The official Jacoco Java documentation mentions sonar.jacoco.reportMissing.force.zero=true . My SonarQube analysis will be done using maven builds and SonarQube 5.6.6 and sonar-java 4.11.0.10660. How can I set

Generating code coverage reports on Azure DevOps with Gradle 5.X

一个人想着一个人 提交于 2019-12-11 15:27:21
问题 I'm trying to upgrade my project to Gradle 5.6.2. One of the tasks that I run on Azure DevOps is: - task: Gradle@2 displayName: 'Test Project' inputs: gradleWrapperFile: 'gradlew' gradleOptions: '-Xmx7000m' sonarQubeRunAnalysis: true sonarQubeGradlePluginVersion: 2.6.2 testRunTitle: $(DISPLAY_NAME) codeCoverageToolOption: JaCoCo publishJUnitResults: true testResultsFiles: '**/build/test-results/test/TEST-*.xml' tasks: "test -Dtest.profile=unit --parallel" After upgrading to Gradle 5.6.2 I get

sonar.coverage.exclusions and integration tests coverage

南笙酒味 提交于 2019-12-11 12:15:43
问题 I had a maven module that got analyzed for both Unit-tests and Integration-Tests coverage. I specifically added sonar.coverage.exclusions to the maven module that I wanted to exclude from coverage analysis. It worked well with the UT, but the module was still analyzed for IT coverage and I got weird behavior where the overall coverage is smaller than the UT coverage because it looks at more code. I'm using SonarQube 4.5 with java plugin 2.9.1. 来源: https://stackoverflow.com/questions/29239340

Find code coverage for multi module maven project

强颜欢笑 提交于 2019-12-11 04:47:40
问题 I have a multi module maven project in one git repository and my integration test cases on another git repository. The output of multi module maven project is three jars for three modules. Now is there a way via command line (so that we can run this through jenkins) to find code coverage for integration tests that are in another repository. The JAR when ran through java -jar <<jarname>> it starts a jetty server with the application. 回答1: You can execute your jar with JaCoCo agent to gather

How to set up jacoco4sbt to process classes in main and submodules in Play?

北城余情 提交于 2019-12-11 03:59:19
问题 I'm having some problems to make jacoco4sbt working with my Play 2.3.4 project. My project is composed of 3 submodules: common , api and frontend and has no code in the app root folder. Now when I run Jacoco it does not find the submodules classes. Inspecting target/scala-VERSION/classes I only find some routing classes (which in fact is the only code I have in my "root" project, but I was expecting that because I aggregate all those projects the classes would be there). If I copy the classes

How to run Jacoco with Java 7 and spring-instrument?

天涯浪子 提交于 2019-12-11 03:57:50
问题 Since I had some problems using cobertura with Java 7 - I'm trying Jacoco . My project has a parent pom.xml and sub projects. In one project I use spring to run some integration tests - so I have this plugin in this project's pom.xml : <plugin> <version>2.12.4</version> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- -XX:-UseSplitVerifier is for java 7 --> <argLine> -XX:-UseSplitVerifier -javaagent:${settings.localRepository}/org

jacoco only shows coverage for classes in the same module

自作多情 提交于 2019-12-11 03:10:41
问题 I have a somewhat large multi-module Maven project. I have the unit tests in each module being processed by Jacoco. I have a separate child module doing "merge" and "report-aggregate", and this appears to be generating data. I'm even using the generated data in SonarQube. Most of my tests are using PowerMock, and I'm using offline instrumentation. However, after looking closer at the coverage data, I see that it is leaving out coverage data for classes and methods that I know are being

How to fix unstable builds when thresholds are met?

余生长醉 提交于 2019-12-11 01:32:50
问题 My overall coverage is meeting the threshold, but still build is marked as Unstable. Does anyone know the reason for this? 16:53:04 [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=75, maxClass=99, minMethod=75, maxMethod=99, minLine=75, maxLine=99, minBranch=40, maxBranch=99, minInstruction=65, maxInstruction=99, minComplexity=0, maxComplexity=99] 16:53:04 [JaCoCo plugin] Publishing the results.. 16:53:04 [JaCoCo plugin] Loading packages.. 16:53:04 [JaCoCo plugin] Done. 16