Skip to content

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

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

fix(ci): preserve PD and Store coverage aggregation#3161
contrueCT wants to merge 4 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 and
    verify the complete expected session set before upload.
  • Require a non-zero Surefire test count for every active suite. Preserve the
    existing Store core/server profile invocations and require their exact
    reports, while allowing their current placeholder suites to report zero
    tests.
  • Make CoreSuiteTest an explicit empty JUnit suite, without enabling its
    commented child tests, so Surefire emits the required placeholder report.
  • 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,
    active and placeholder zero-test rules, 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.
    • Surefire 2.20 smoke: compile the exact Store core/server suite sources and
      verify both expected XML reports are emitted with tests=0.

The complete four-suite PD/six-profile 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.

Comment thread .github/workflows/pd-store-ci.yml
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