[KYUUBI #7659][INFRA] Restore code coverage - #7661
Closed
acruise wants to merge 2 commits into
Closed
Conversation
…he 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 apache#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 apache#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.
Assisted-by: Claude Opus 5
acruise
force-pushed
the
kyuubi-7659-codecov-argline
branch
from
August 25, 2026 20:11
4b142d7 to
a9b8cd0
Compare
Contributor
|
Thanks for fixing this. I found one remaining <argLine>${extraJavaTestArgs}</argLine>It has the same effect on the Data Agent JUnit tests. With the current patch, Could you remove this override as part of this PR? |
…gent-engine The root pom now defines the argLine property, so this override only shadows jacoco:prepare-agent for this module. Assisted-by: GLM 5.3
pan3793
approved these changes
Sep 4, 2026
pan3793
added a commit
that referenced
this pull request
Sep 4, 2026
...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
Closes #7661 from acruise/kyuubi-7659-codecov-argline.
Closes #7659
1b211e0 [Cheng Pan] [KYUUBI #7659][INFRA] Drop redundant argLine override in data-agent-engine
a9b8cd0 [Alex Cruise] [KYUUBI #7659][INFRA] Restore code coverage by not overriding the test argLine
Lead-authored-by: Alex Cruise <alex@cluonflux.com>
Co-authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit a162cde)
Signed-off-by: Cheng Pan <chengpan@apache.org>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...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
argLineto the${argLine}property, which is resolved when the mojo runs -- late enough to see the valuejacoco:prepare-agentpublishes 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:The build stays green and every module reports zero. KYUUBI #756 ("Recover CODECOV") fixed the same thing in 2021 by deleting an
argLineelement.Move the JDK options into the
argLineproperty itself and drop both overrides, so the plugin defaults apply again.prepare-agentprepends the agent to the property's existing value rather than replacing it, so--add-openssurvives: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-scalawithout the profile is green, argLine unchanged.Was this patch assisted by generative AI tooling?
Yes, Claude Opus 5