Skip to content

fix(ci): preserve PD and Store coverage aggregation - #3161

Draft
contrueCT wants to merge 2 commits into
apache:masterfrom
contrueCT:task/fix-jacoco-codecov-aggregation
Draft

fix(ci): preserve PD and Store coverage aggregation#3161
contrueCT wants to merge 2 commits into
apache:masterfrom
contrueCT:task/fix-jacoco-codecov-aggregation

Conversation

@contrueCT

@contrueCT contrueCT commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Purpose of the PR

PD and Store CI run several Maven test profiles in separate invocations, but
each invocation previously replaced JaCoCo execution data and generated a
partial report. PD also ran mvn clean package after two coverage-producing
test profiles, deleting their data before upload. As a result, Codecov could
receive only the last profile's coverage or an imprecisely selected report.

The existing JaCoCo 0.8.4 configuration also cannot instrument Java 17 class
files, which blocks the project's planned Java 17 migration.

Main Changes

  • Move the PD clean/package step before all coverage-producing test profiles.
  • Upgrade PD and Store JaCoCo plugins from 0.8.4 to 0.8.8 and append execution
    data across Maven invocations.
  • Assign a deterministic JaCoCo session ID to every PD/Store test profile, then
    verify that the final report contains the complete expected session set.
  • Generate one aggregate XML report during verify and upload that exact file
    to Codecov.
  • Include hg-store-rocksdb as a direct report-aggregate dependency only in
    the jacoco profile so normal Store test dependency resolution is unchanged.
  • Run EditorConfig before tests create RocksDB runtime files, then skip only
    that already-completed check during the final aggregate-only verify.
  • Add a validator and contract tests for missing reports, uncovered reports,
    missing suites, missing modules, Maven lifecycle bindings, dependency scope,
    and workflow paths.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • hugegraph-server/hugegraph-dist/src/assembly/travis/test-check-jacoco-report.sh
    • Parse .github/workflows/pd-store-ci.yml with PyYAML and all changed POMs
      with xmllint.
    • mvn -q apache-rat:check -N -ntp
    • mvn editorconfig:check -pl hugegraph-pd/hg-pd-test -am -ntp
    • mvn editorconfig:check -pl hugegraph-store/hg-store-test -am -ntp
    • mvn verify -pl hugegraph-pd/hg-pd-test -am -P jacoco -DskipTests -Deditorconfig.skip=true -ntp
    • mvn verify -pl hugegraph-store/hg-store-test -am -P jacoco -DskipTests -Deditorconfig.skip=true -ntp
    • Verify the normal Store dependency tree still resolves PowerMock's
      org.javassist:javassist:3.24.0-GA.
    • Java 17 smoke: JaCoCo 0.8.4 rejects class-file major version 61, while
      0.8.8 instruments the same class and writes execution data successfully.

The complete ten-profile PD/Store workflow and the external Codecov upload are
left to GitHub Actions because the local environment uses JDK 17 while this
workflow currently installs JDK 11.

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] JaCoCo coverage is overwritten across PD/Store CI test profiles

1 participant