jacoco

Jacoco Coverage Report is displaying excluded folders with 0% coverage

喜你入骨 提交于 2019-12-25 08:19:52
问题 I have attached jacocoagent with my Tomcat server. I am able to get data in jacoco.exec and HTML report but I want to exclude some folders from my coverage report. After adding following command, now I can see excluded folders name in my coverage report with 0% coverage. How can I exclude the following folders from the report. Are these excluded folders still contributing in total coverage percentage which is 15% at the moment? I have added following command in my Catilina.bat file: set JAVA

Why do Jacoco excludes java classes?

余生颓废 提交于 2019-12-25 02:46:29
问题 I'm running the command mvn sonar:sonar . Here's the output from Jenkins: [JaCoCo plugin] Source Inclusions: **/*.java [JaCoCo plugin] Source Exclusions: [JaCoCo plugin] - <PATH>/workspace/<MODULE1>/src/main/java 10 files [JaCoCo plugin] - <PATH>/workspace/<MODULE2>/src/main/java 1 files [JaCoCo plugin] - <PATH>/workspace/<MODULE3>/src/main/java 65 files [JaCoCo plugin] - <PATH>/workspace/<MODULE4>/src/main/java 5 files [JaCoCo plugin] - <PATH>/workspace/<MODULE5>/src/main/java 64 files Why

how do I make jacoco add the tests files themselves to the coverage report

时间秒杀一切 提交于 2019-12-24 19:07:37
问题 In my sample maven project, I have this jacoco configuration: <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.4</version> <executions> <execution> <id>jacoco-initialize</id> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>jacoco-report</id> <phase>test</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> which I got from https://automationrhapsody.com/automated-code-coverage-of-unit-tests

Cannot add task ':jacocoTestReport' as a task with that name already exists

社会主义新天地 提交于 2019-12-24 07:25:04
问题 I am trying to add the following task so that I can get some coverage data in my java + kotlin project (for what it is worth, this is a gradle project)... but I get the following error : "Cannot add task ':jacocoTestReport' as a task with that name already exists" Here is the actual task I am trying to add : task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") { group = "Reporting" description = "Generate Jacoco coverage reports for Debug build" reports { xml.enabled =

EclEmma(Jacocco) shows line not covered even if the line is executed

China☆狼群 提交于 2019-12-24 03:46:09
问题 I am trying improve line coverage for my code. A line gets executed where i am calling a method which in turn will throw an exception. But line coverage shows red color meaning the line was not executed. Code: 1 public void myMethod(SomeService someService){ 2 throwException(someService); 3 } 4 public void throwException(SomeService someService){ 5 THROW an exception here 6 } In my test class I am preparing SomeService required data and calling myMethod from above code. line # 2 shows red

Error running maven surefire test plugin Java 11

与世无争的帅哥 提交于 2019-12-23 20:55:05
问题 I am running some tests for Spring Boot app in Team City using the maven surefire plugin version 2.22.1. Spring Boot version is 2.1.2. I have specified in the configuration to use a forked Java 11 jvm as follows: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkCount>1</forkCount> <jvm>${jdk11.home}/bin/java</jvm> <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> </configuration> </plugin> When running Team City I get the

Jacoco how to correctly exclude package

瘦欲@ 提交于 2019-12-23 19:04:59
问题 I am using the Jacoco Maven plugin version 0.8.1 (With Java 8 / Maven 3.1.0). Cannot get Jacoco to work with path exclusions. I would like to exclude these packages : my.package.model my.package.exception What I tried : <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.1</version> <executions> <execution> <id>prepare-agent</id> <goals> <goal>prepare-agent</goal> </goals> </execution> </executions> <configuration> <excludes>

JaCoCo shows 0% coverage, even all tests had passed

ⅰ亾dé卋堺 提交于 2019-12-23 14:20:47
问题 I have written some test cases under androidTest directory. I am using androidx ( testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ) added dependencies: androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test:rules:1.1.0' added JaCoCo as dependency, as well. When I run createDebugAndroidTestCoverageReport Gradle task, all the test cases run successfully but coverage is 0% in report I am guessing that is due to this error: V

Generate coverage for other modules

痴心易碎 提交于 2019-12-23 13:06:40
问题 My project structure is as follows: :app , :core . :app is the Android application project, and it depends on :core which has all the business logic. I have Espresso tests for :app , and I am able to run and get coverage report thanks to all the questions and guides out there. But the coverage is only for code in :app . How do I get coverage for all projects ( :app and :core ) resulting from my Espresso instrumentation tests? Is this even possible? Any help is greatly appreciated. 回答1: Even

Jacoco进行远程覆盖率统计

不问归期 提交于 2019-12-23 12:15:25
首先下载jacoco的jar包及ant的jar包 jacoco下载 , jacoco的jar包上传到服务器(我这里用的是jacoco0.8.5) 在linux的启动脚本增加如下红色字体配置:(对应配合Java_opts也可) nohup java -Xbootclasspath/a:/conf/ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dspring.config.location=conf/application.yml,conf/datariver.properties -Ddatariver.conf=conf/ -javaagent:/root/jacoco-0.8.5/lib/jacocoagent.jar=includes=*,output=tcpserver,port=8044,address=192.168.144.174 -jar dataexplorer-web-1.5.0-SNAPSHOT.jar >> /dev/null 2>&1 & 本地配置: ant的bin目录下配置build.xml: build.xml <?xml version="1.0" encoding="UTF-8"?> <project name="plate_id_sample_service