jacoco

Jacoco code coverage for remote machine

雨燕双飞 提交于 2019-12-23 12:03:28
问题 I tried to find this answer but hardly found it anywhere. I am doing the API testing, In process I need to call the rest API from my local machine. local machine contains the maven project and a framework to call respective rest API. I need to check the code coverage of remote Rest API and form a report based on the code coverage. please help, how to do that? Note: I found this link useful but it does not elaborate clearly on what to do? http://eclemma.org/jacoco/trunk/doc/agent.html 回答1: you

SonarQube Coverage for Branch

谁都会走 提交于 2019-12-23 11:46:36
问题 Is it possible to get code coverage details for non-master branches in SonarQube? The only two tabs I see for other branches are Issues and Code . I am running the same Gradle JaCoCo/Sonar commands for each branch: ./gradlew report sonarqube -Dsonar.branch.name=${BITBUCKET_BRANCH} -Dsonar.organization=${SONARQUBE_ORG} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARQUBE_KEY} I am using PowerMockito so I need the class instrumentation done by the report task. We are using Java,

JaCoCo: missing classes directory

 ̄綄美尐妖づ 提交于 2019-12-23 09:34:05
问题 I am fairly new to JaCoCo and I am having trouble generating my code coverage report. This is my project structure: My integration tests live within the "...-integration-tests" module. When I build my project using mvn I get the following in my logging: [INFO] Skipping JaCoCo execution due to missing classes directory: ...-integration-tests\target\classes This is true because my compiled code is only available in the target>classes of the corresponding module. What is the best way to make

Jacoco and jetty maven plugin gets 0% coverage

拥有回忆 提交于 2019-12-23 05:23:11
问题 I'm trying to setup jacoco to get the coverage for my integration tests. I'm running my integration tests against jetty (using the maven plugin). But even if i pass the agent in the jam args when starting up the jetty server the jacoco report shows 0%. Here is my pom.xml <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> <goals> <goal>run-forked</goal> </goals> <configuration>

How to get JaCoCo instrumentation code coverage while executing webApplication on server

[亡魂溺海] 提交于 2019-12-23 05:06:30
问题 I want to get a code coverage report (or tracking controller flow of an application) when I execute the some scenario on live application i.e. while application running in server, so I have refereed the official Jacoco documentation and did as fallows As a first step, I tried to bind the jacoco agent to the application running port export MAVEN_OPTS=-javaagent:/home/user/.m2/repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=includes=*

jacoco-maven-plugin causes site plugin to fail in multimodule project

∥☆過路亽.° 提交于 2019-12-23 03:48:08
问题 Last time I've decided to replace Cobertura plugin with JaCoCo plugin in my Java projects Maven builds. One of them is a multimodule project with inter-module dependencies: *-- pl.chilldev.commons |-- commons-concurrent |-- commons-daemon `-- commons-exception The thing is that commons-daemon depends on commons-exception . I have jacoco-maven-plugin configured following way: <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.1.201405082137<

Exclude package from jacoco code coverage for Android

陌路散爱 提交于 2019-12-23 03:42:21
问题 I'm trying to exclude generated files by GreenDao framework, which placed in a package named dao, from my code coverage report generated by Jacoco, but creating a custom task like following doesn't work. def coverageSourceDirs = [ '../app/src/main/java' ] task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") { group = "Reporting" description = "Generate Jacoco coverage reports after running tests." reports { xml.enabled = true html.enabled = true } classDirectories = fileTree( dir

JaCoCo with microservice project architecture?

孤者浪人 提交于 2019-12-23 03:03:19
问题 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:

How to add more Jacoco exclusions in a child project?

你说的曾经没有我的故事 提交于 2019-12-22 12:20:02
问题 In a parent POM we have Jacoco rules set up to enforce test coverage. This includes some exclusions for classes that typically don't have behavior: <execution> <id>default-check</id> <goals> <goal>check</goal> </goals> <configuration> <excludes> <!-- exclude largely auto-generated domain and model classes --> <exclude>**/model/*.class</exclude> <exclude>**/model/**/*.class</exclude> <exclude>**/domain/*.class</exclude> <exclude>**/domain/**/*.class</exclude> <exclude>**/dto/*.class</exclude>

How to attach JaCoCo Agent to application server

巧了我就是萌 提交于 2019-12-22 07:47:37
问题 I am using JBoss and running Selenium tests from Jenkins. I want to measure code coverage from Selenium tests, so apparently I should attach the JaCoCo java agent to the server. I have done like this: ./run.sh -c Default -Djavaagent:[path to Jenkins workspace]/tools/libs/jacocoagent.jar=destfile=[path to Jenkins]/jacoco.exec However, no output file is ever generated. I am here pointing to jacocoagent.jar in the Jenkins path, but is it so that the jacocoagent.jar and jacoco.exec must be in the