testjacoco.patch uploads as an attachment.
diff --git
a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
index ee0a577..c74eccd 100644
--- a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
+++ b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
@@ -112,7 +112,7 @@ class HeartbeatReceiverSuite
assert(trackedExecutors.contains(executorId1))
assert(trackedExecutors.contains(executorId2))
}
-
+/***
test("reregister if scheduler is not ready yet") {
addExecutorAndVerify(executorId1)
// Task scheduler is not set yet in HeartbeatReceiver, so executors should
reregister
@@ -236,7 +236,7 @@ class HeartbeatReceiverSuite
sc.stopped.set(false)
}
}
-
+*/
/** Manually send a heartbeat and return the response. */
private def triggerHeartbeat(
executorId: String,
diff --git a/pom.xml b/pom.xml
index 93d696d..ffe3b37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2918,7 +2918,7 @@
<arg>-feature</arg>
<arg>-explaintypes</arg>
<arg>-target:jvm-1.8</arg>
- <arg>-Xfatal-warnings</arg>
+ <!-- <arg>-Xfatal-warnings</arg> -->
<arg>-Ywarn-unused:imports</arg>
<arg>-P:silencer:globalFilters=.*deprecated.*</arg>
</args>
@@ -2975,7 +2975,7 @@
<include>**/*Suite.java</include>
</includes>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
- <argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g
-XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs}
-Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g
-XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs}
-Dio.netty.tryReflectionSetAccessible=true</argLine>
<environmentVariables>
<!--
Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child
processes
@@ -3029,7 +3029,7 @@
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>SparkTestSuite.txt</filereports>
- <argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g
-XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs}
-Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g
-XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs}
-Dio.netty.tryReflectionSetAccessible=true</argLine>
<stderr/>
<environmentVariables>
<!--
@@ -3480,6 +3480,25 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.8.12</version>
+ <executions>
+ <execution>
+ <id>default-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/sql/core/pom.xml b/sql/core/pom.xml
index 7313ee5..8340308 100644
--- a/sql/core/pom.xml
+++ b/sql/core/pom.xml
@@ -248,7 +248,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
- <argLine>-ea -Xmx4g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize}
${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m
-XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs}
-Dio.netty.tryReflectionSetAccessible=true</argLine>
</configuration>
</plugin>
<plugin>
在2024年9月2日星期一 UTC+8 11:49:32<Lipeng Guo> 写道:
> hi,
> i add jacoco to a scala project(apache spark), and run `mvn verify`,then
> jacoco successfully generate execution data file and report.
> but the coverage rate in jacoco report page doesnt match the green colored
> lines count in source file page.
> for example, after test, the method
> `org$apache$spark$HeartbeatReceiver$$expireDeadHosts()` has many missed
> instruction which is highligted red in source file page, but jacoco report
> page show that the method coverage rate is 100%.
> i assumed that the highlight color in source file is depend on
> jacoco.exec.(is it right?)
> i test jacoco for the scala's `for loop` syntax in a helloworld scala
> project and it works fine.
>
> i search thorough the jacoco faq but doesnt solve it, could you please
> help me find whats wrong?
>
> problem reproduce:
> ($ java -version
> java version "1.8.0_261"
> Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
> )
> git clone [email protected]:apache/spark.git
> cd spark
> git checkout v3.5.0
> git apply testjacoco.patch
> ./build/mvn -Dtest=none
> -DwildcardSuites="org.apache.spark.HeartbeatReceiverSuite" -pl
> org.apache.spark:spark-core_2.12 clean verify
>
>
> [image: report.png]
> [image: sourcefile.png]
>
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/b2ffe3a7-56c8-410b-b12f-f1c08222a752n%40googlegroups.com.
diff --git a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
index ee0a577..c74eccd 100644
--- a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
+++ b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
@@ -112,7 +112,7 @@ class HeartbeatReceiverSuite
assert(trackedExecutors.contains(executorId1))
assert(trackedExecutors.contains(executorId2))
}
-
+/***
test("reregister if scheduler is not ready yet") {
addExecutorAndVerify(executorId1)
// Task scheduler is not set yet in HeartbeatReceiver, so executors should reregister
@@ -236,7 +236,7 @@ class HeartbeatReceiverSuite
sc.stopped.set(false)
}
}
-
+*/
/** Manually send a heartbeat and return the response. */
private def triggerHeartbeat(
executorId: String,
diff --git a/pom.xml b/pom.xml
index 93d696d..ffe3b37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2918,7 +2918,7 @@
<arg>-feature</arg>
<arg>-explaintypes</arg>
<arg>-target:jvm-1.8</arg>
- <arg>-Xfatal-warnings</arg>
+ <!-- <arg>-Xfatal-warnings</arg> -->
<arg>-Ywarn-unused:imports</arg>
<arg>-P:silencer:globalFilters=.*deprecated.*</arg>
</args>
@@ -2975,7 +2975,7 @@
<include>**/*Suite.java</include>
</includes>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
- <argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<environmentVariables>
<!--
Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes
@@ -3029,7 +3029,7 @@
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>SparkTestSuite.txt</filereports>
- <argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<stderr/>
<environmentVariables>
<!--
@@ -3480,6 +3480,25 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.8.12</version>
+ <executions>
+ <execution>
+ <id>default-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/sql/core/pom.xml b/sql/core/pom.xml
index 7313ee5..8340308 100644
--- a/sql/core/pom.xml
+++ b/sql/core/pom.xml
@@ -248,7 +248,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
- <argLine>-ea -Xmx4g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
+ <argLine>${argLine} -ea -Xmx4g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraJavaTestArgs} -Dio.netty.tryReflectionSetAccessible=true</argLine>
</configuration>
</plugin>
<plugin>