jacoco

How to attach JaCoCo Agent to application server

守給你的承諾、 提交于 2019-12-22 07:47:11
问题 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

How can I integrate Jacoco reports with SonarQube without using maven?

怎甘沉沦 提交于 2019-12-22 04:12:09
问题 I used Jacoco eclipse plugin to measure unit test coverage and I was able to export a report using it. I want to integrate that report with sonar so I gave the path to it in the project properties file. My properties file looks like this # Required metadata sonar.projectKey=key sonar.projectName=name sonar.projectVersion=1.0 sonar.jacoco.reportPath=jacoco.exec sonar.tests=junit sonar.dynamicAnalysis=reuseReports sonar.java.coveragePlugin=jacoco sonar.jacoco.reportMissing.force.zero=true #

packaging jacoco-agent.properties into an APK so it can be read?

烈酒焚心 提交于 2019-12-21 22:20:57
问题 Here's my situation: Background I am investigating code-coverage for our Android app. The app is built with Gradle and Android Studio. I need code-coverage reports in two situations: during manual tests, and during automated tests built with our sizeable Appium suite. I need to get a proof-of-concept out fast (isn't that always the case?) so I haven't had the chance to do thorough R&D. So please forgive any ignorance I display :) I have access to the app source, but have little knowledge of

JaCoCo + Mockito + Android tests: Zero coverage reported

十年热恋 提交于 2019-12-21 21:05:25
问题 I know there are quite a few questions (and answers) for this topic, but I've tried everything I found in SO and other sites and I haven't found a way to make JaCoCo include coverage for Android tests that use Mockito. My problem: I want to use JaCoCo to generate code coverage of both Unit Test and Instrumentation Test (androidTest). I'm using Mockito to mock some of the classes. I found a sample in GitHub to use JaCoCo and used it as a starting point. https://github.com/rafaeltoledo/unified

Coverage view shows 0.0% in Intellij when using Jacoco

不羁岁月 提交于 2019-12-21 06:46:20
问题 As discussed in Open JaCoCo report in Intellij IDEA, when I gather code coverage statistics using Jacoco (rather than native IntelliJ tracing) 0.0% (i.e. "no" coverage) is always shown in the coverage window. This is after I have done the whole "Analyze -> Show coverage data..." and selected my generated "jacoco.exec" file. The same "jacoco.exec" file works fine with other tools such as the Jacoco native report generation task, and with Sonar, and these produce the expected coverage report

How to supply Jacoco agent to an Android app?

血红的双手。 提交于 2019-12-21 06:06:34
问题 I am trying to get code coverage using Jacoco for manual testing. I am trying to use offline instrumentation. http://www.eclemma.org/jacoco/trunk/doc/offline.html In there it mentions: Configuration File: If a file jacoco-agent.properties is supplied on the classpath options are loaded from this file. My question is how do I supply this? On some other forum, I saw that jacoco-agent.properties needs to be deployed with the app. I tried putting jacoco-agent.properties under the res/raw, but it

JaCoCo: exclude generated methods (using it with Lombok)

╄→尐↘猪︶ㄣ 提交于 2019-12-21 03:21:06
问题 I am using JaCoCo and it is considering methods generated by Lombok (generated in the bytecode, not trace of them in the source code). How can I configure JaCoCo to ignore them? 回答1: Use the excludes tag provide by jacoco. <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.4.201502262128</version> <configuration> <excludes> <exclude>**/config/**</exclude> <exclude>**/model/**</exclude> <exclude>**/item/**</exclude> </excludes> </configuration> 回答2: Also another way to exclude lombok

Gradle : How to generate coverage report for Integration test using jacoco

痞子三分冷 提交于 2019-12-20 12:59:31
问题 I am new to gradle. I am using the below code. But it generates coverage for unit test cases. But it didn't generate for integration test cases. I have my test classes in the package src/test/java. test { dependsOn jettyRunWar ignoreFailures true finalizedBy jettyStop } apply plugin: 'jacoco' jacocoTestReport { group = "Reporting" description = "Generate Jacoco coverage reports after running tests." additionalSourceDirs = files(sourceSets.main.allJava.srcDirs) } 回答1: Using Gradle 5.4.1 (and

Need to generate Code Coverage Reports using jacoco.exec file

◇◆丶佛笑我妖孽 提交于 2019-12-20 05:25:29
问题 I have application war file deployed on Jboss 7 server. I able to generate jacoco.exec file by adding following JVM option javaagent:/jboss/common/lib/jacocoagent.jar=destfile=/root/jacoco/jacoco.exec,includes=*,append=true,output=file I want to have code coverage report generated automatically without using eclipse/ plugins. 回答1: I am able to generate jacoco reports using following steps: Step A: Modify / add JVM option in conf file ../jboss/bin/run.conf JAVA_OPTS=-javaagent:../jboss/common

Arquillian integration test code coverage issue with Jacoco

对着背影说爱祢 提交于 2019-12-20 05:19:17
问题 I am doing integration testing using arquillian and tomee remote plugin. it is working good. But my code coverage is not working. I am using Jacoco plugin for code coverage. Getting Exception in my Java class java.lang.instrument.IllegalClassFormatException: Error while instrumenting com/demo/EmpService How to do code coverage in remote container using Jacoco ? Note: I have passed javaagent ( argLine ) to server catalina opts in integration phase. I am injecting my bean in test class and