acruise opened a new pull request, #7660:
URL: https://github.com/apache/kyuubi/pull/7660

   This restores code coverage by not overriding the test `argLine`
   
   Code coverage has reported nothing since 1.8.0. Both maven-surefire-plugin 
and scalatest-maven-plugin default their `argLine` to the `${argLine}` 
property, which is resolved when the mojo runs -- late enough to see the value 
`jacoco:prepare-agent` publishes there. KYUUBI #4849 gave both plugins an 
explicit `<argLine>${extraJavaTestArgs}</argLine>` to open JDK modules, and 
plugin configuration is interpolated during model building, long before the 
agent mojo runs. The agent option is therefore dropped and the forked test JVM 
runs uninstrumented:
   
       [INFO] --- jacoco:0.8.11:prepare-agent (pre-test) @ 
kyuubi-util-scala_2.12 ---
       [INFO] argLine set to 
-javaagent:.../org.jacoco.agent-0.8.11-runtime.jar=...
       [INFO] --- jacoco:0.8.11:report (report) @ kyuubi-util-scala_2.12 ---
       [INFO] Skipping JaCoCo execution due to missing execution data file.
   
   The build stays green and every module reports zero. KYUUBI #756 ("Recover 
CODECOV") fixed the same thing in 2021 by deleting an `argLine` element.
   
   Move the JDK options into the `argLine` property itself and drop both 
overrides, so the plugin defaults apply again. `prepare-agent` prepends the 
agent to the property's existing value rather than replacing it, so 
`--add-opens` survives:
   
       argLine set to -javaagent:...=destfile=... 
-XX:+IgnoreUnrecognizedVMOptions ...
   
   Surefire's `@{argLine}` late replacement is not enough on its own here, 
since scalatest-maven-plugin has no equivalent and that is where most of 
Kyuubi's tests run.
   
   Verified locally:
   
     - `test -Pcodecov -pl kyuubi-util-scala` (scalatest) analyzes 8 classes 
and writes target/jacoco.exec, where before it skipped for missing data.
     - `test -Pcodecov -pl kyuubi-rest-client` (surefire) analyzes 63 classes.
     - `test -pl kyuubi-util-scala` without the profile is green, argLine 
unchanged.
   
   
   ### Was this patch assisted by generative AI tooling?
   
   Yes, Claude Opus 5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to