Skip to content

[KYUUBI #7659][INFRA] Restore code coverage - #7661

Closed
acruise wants to merge 2 commits into
apache:masterfrom
acruise:kyuubi-7659-codecov-argline
Closed

[KYUUBI #7659][INFRA] Restore code coverage #7661
acruise wants to merge 2 commits into
apache:masterfrom
acruise:kyuubi-7659-codecov-argline

Conversation

@acruise

@acruise acruise commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

...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

…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
acruise force-pushed the kyuubi-7659-codecov-argline branch from 4b142d7 to a9b8cd0 Compare August 25, 2026 20:11
@wangzhigang1999

Copy link
Copy Markdown
Contributor

Thanks for fixing this. I found one remaining argLine override in externals/kyuubi-data-agent-engine/pom.xml:

<argLine>${extraJavaTestArgs}</argLine>

It has the same effect on the Data Agent JUnit tests. With the current patch, TableRefTest runs 17 tests successfully, but JaCoCo reports zero covered lines for the module. After removing this line, the same tests pass and JaCoCo records 21 covered lines for TableRef.

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 pan3793 added this to the v1.12.1 milestone Sep 4, 2026
@pan3793 pan3793 closed this in a162cde 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>
@pan3793

pan3793 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Merge Summary:

Posted by merge_kyuubi_pr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants