Skip to content

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

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

fix(ci): preserve PD and Store coverage aggregation#3161
contrueCT wants to merge 3 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 active PD/Store test suite,
    then verify the complete expected session set and each suite's non-zero
    Surefire test count before upload.
  • Stop counting the empty Store core/server suite placeholders as executed
    coverage suites; both currently report Tests run: 0.
  • 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 malformed arguments, missing reports,
    zero-test suites, uncovered reports, missing sessions/modules, Maven lifecycle
    bindings, dependency scope, and exact workflow inputs.

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-server/hugegraph-dist -am -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 eight-suite 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

@contrueCT
contrueCT marked this pull request as ready for review August 19, 2026 14:34
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. ci-cd Build or deploy pd PD module store Store module labels Aug 19, 2026

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: no. Summary: The aggregate report and Maven lifecycle checks pass, but the validator can accept incomplete suite/module coverage and can hang on malformed arguments. Evidence: Exact-head PD/Store aggregate builds and validator contract tests passed; current-head CI Codecov uploads returned HTTP 429 and exited 0.

Comment thread hugegraph-server/hugegraph-dist/src/assembly/travis/check-jacoco-report.sh Outdated
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 19, 2026

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: yes. Summary: The Store CI job drops two existing test suites while still publishing an aggregate coverage report, so the coverage gate no longer represents the full Store test scope. Evidence: exact-head .github/workflows/pd-store-ci.yml patch and hg-store-test/pom.xml suite definitions.

mvn test -pl hugegraph-store/hg-store-test -am \
-P store-raftcore-test -Djacoco.sessionId=store-raftcore-test

- name: Generate aggregate coverage report

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

⚠️ Important

Blocking: yes. The Store job no longer runs the existing store-core-test or store-server-test suites, even though both executions remain in hg-store-test/pom.xml and the aggregate report still claims coverage for hg-store-core and hg-store-node. This makes the CI gate a partial test run while presenting a full Store report. Restore both profiles and require their reports/sessions, or explicitly remove them from the covered scope with a documented replacement.

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

Labels

ci-cd Build or deploy pd PD module size:XL This PR changes 500-999 lines, ignoring generated files. store Store module

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

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

2 participants