Skip to content

chore(ci): upload integration-test coverage to Codecov#19130

Merged
nsivabalan merged 1 commit into
apache:masterfrom
yihua:integ-test-codecov
Jul 1, 2026
Merged

chore(ci): upload integration-test coverage to Codecov#19130
nsivabalan merged 1 commit into
apache:masterfrom
yihua:integ-test-codecov

Conversation

@yihua

@yihua yihua commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Describe the issue this Pull Request addresses

The integration-tests GitHub Actions job runs the Hudi CLI and hudi-integ-test integration tests, but reported no code coverage to Codecov. The integration-tests Maven profile wired no JaCoCo agent (unlike the unit-tests / functional-tests* profiles), so no .exec data was produced, and the job had no coverage upload step. Because hudi-cli is excluded from the unit/functional test jobs, its production code was exercised only by these integration tests and its coverage was never reported.

Summary and Changelog

Report integration-test coverage to Codecov, closing the hudi-cli blind spot.

  • pom.xml: add a JaCoCo prepare-agent execution to the integration-tests profile, writing exec data under target/jacoco-agent/ so the existing scripts/jacoco/generate_merged_coverage_report.sh picks it up. The agent is appended to the argLine property, which both failsafe (IT) and surefire (integ-test UT) already consume.
  • .github/workflows/bot.yml: enable JaCoCo on the UT integ-test and IT steps (-Djacoco.skip=false), and add the standard "Generate merged coverage report" + "Upload coverage to Codecov" steps (flag integration-tests), mirroring the other test jobs.

Scope is limited to the integration-tests job; the Flink integration-test jobs are intentionally left out.

Impact

CI only; no production code or public API change. The integration-tests job now uploads coverage under the integration-tests flag.

Risk Level

low

CI-only change. It reuses the same JaCoCo agent plus merge/upload path already proven by the unit/functional test jobs. Failsafe/surefire memory settings are unchanged, since the agent is appended to the existing argLine property rather than replacing it.

Documentation Update

none

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable
The integration-tests job runs the Hudi CLI and integ-test module
integration tests but reported no coverage to Codecov: the
integration-tests Maven profile wired no JaCoCo agent, and the job had no
upload step. Since hudi-cli is excluded from the unit/functional test
jobs, its production code was covered only here and never reported.

- pom.xml: add a JaCoCo prepare-agent execution to the integration-tests
  profile, writing exec data under target/jacoco-agent/ so the existing
  merge script picks it up. Both failsafe (IT) and surefire (integ-test
  UT) attach the agent via the argLine property.
- bot.yml: enable jacoco on the UT integ-test and IT steps
  (-Djacoco.skip=false) and add the standard merged-report + Codecov
  upload steps (flag: integration-tests).

@hudi-agent hudi-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for working on this! This PR wires a JaCoCo prepare-agent execution into the integration-tests Maven profile and adds the coverage merge/upload steps to CI, closing the hudi-cli coverage blind spot. The approach mirrors the existing unit/functional-test profiles; one interaction with combine.self="override" in this profile's surefire/failsafe config is worth double-checking (see inline comment). Please take a look at any inline comments, and this should be ready for a Hudi committer or PMC member to take it from here.

Comment thread pom.xml
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 One difference from the unit/functional-test profiles worth verifying: those use combine.self="append", so they keep the managed <argLine>@{argLine}</argLine>. Here the surefire (line 2307) and failsafe (line 2315) configs use combine.self="override", which drops that managed <argLine> element — so the agent only reaches the forked JVMs via the implicit property="argLine" fallback rather than the late-bound @{argLine}. Could you confirm the .exec files actually come out non-empty and Codecov shows integration-tests coverage? A silent empty upload would still make the job pass green.

⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.

@yihua

yihua commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Note on scope: this intentionally leaves the Flink jobs (test-flink-1, test-flink-2) out of coverage.

When Codecov was first wired up (#18230), jacoco was briefly enabled on the Flink jobs and then removed due to a jacoco + Apache Calcite incompatibility. The agent instruments bytecode with synthetic fields/methods, which breaks the reflection-based structural assertions in Calcite's MetadataDef constructor, failing with:

java.lang.NoClassDefFoundError: Could not initialize class org.apache.calcite.rel.metadata.DefaultRelMetadataProvider
    at org.apache.calcite.plan.RelOptCluster.<init>(RelOptCluster.java:97)
    at org.apache.flink.table.planner.calcite.FlinkRelOptClusterFactory$.create(FlinkRelOptClusterFactory.scala:36)

This PR keeps that constraint intact:

  • Coverage is scoped to the integration-tests job, whose IT step runs mvn verify -Pintegration-tests -pl !hudi-flink-datasource/hudi-flink, so the Flink Calcite planner path is not exercised.
  • The prepare-agent added to the integration-tests profile is a no-op unless a job overrides -Djacoco.skip=false. The Flink IT jobs keep the default -Djacoco.skip from MVN_ARGS, so they stay uninstrumented and the Calcite failure cannot recur.

The one thing to watch is any non-Flink IT that loads Calcite (e.g. Hive-based paths). Monitoring the integration-tests run on this PR to confirm it stays green.

@github-actions github-actions Bot added the size:S PR with lines of changes in (10, 100] label Jul 1, 2026
@yihua

yihua commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Update: the integration-tests job passed and the coverage pipeline ran end to end. Exec files were produced for the non-Flink IT modules (including hudi-cli, ~930 KB, and hudi-integ-test, ~762 KB), merged cleanly, and uploaded to Codecov under the integration-tests flag. No Calcite instrumentation issue surfaced on the non-Flink path.

Note: this is a fork PR, so the upload used Codecov's tokenless path (the CODECOV_TOKEN secret is not exposed to fork PRs); it succeeded here, and the token path applies on push to master.

@hudi-bot

hudi-bot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build
@nsivabalan nsivabalan merged commit 2912bf6 into apache:master Jul 1, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S PR with lines of changes in (10, 100]

5 participants