Skip to content

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

Description

@contrueCT

Bug Type

CI / Test Coverage

Environment

Current master

Expected behavior

The PD and Store CI workflows run multiple test suites in separate Maven invocations:

PD: pd-common-test, pd-core-test, pd-client-test, pd-rest-test
Store: store-common-test, store-client-test, store-core-test,
       store-rocksdb-test, store-server-test, store-raftcore-test

The Codecov upload should represent the union of every suite executed by the job. For
example, coverage produced by KvClientTest during pd-client-test must still be present
after pd-rest-test finishes.

Actual behavior

Coverage from earlier suites can be lost or omitted before upload:

  1. The workflows invoke Maven separately for each profile while reusing module-local JaCoCo
    execution data.
  2. hg-pd-test and hg-store-test regenerate report-aggregate during each test invocation
    instead of producing one final report.
  3. The PD job runs mvn clean package between coverage-producing suites, deleting previously
    collected target data.
  4. Aggregate reports are generated below the test modules, but the workflow points Codecov at
    the repository-level target/site/jacoco path.
  5. Store's aggregate project does not directly depend on hg-store-rocksdb, so the RocksDB
    bundle is not guaranteed to appear in the aggregate report.

A recent example is PR #3157: the focused KvClientTest suite passes and exercises the changed
reconnect paths, but Codecov reports 0% patch coverage for the changed KvClient /
AbstractClient lines.

Java 17 compatibility

PD and Store currently use JaCoCo 0.8.4, which officially supports class files only through
Java 12. HugeGraph is moving toward Java 17, while JaCoCo 0.8.8 is the first release with
official Java 17/18 support and is already used by hugegraph-server/hugegraph-test.

The coverage fix should therefore update the PD/Store JaCoCo configuration to 0.8.8 as part of
making this pipeline usable on Java 17.

Proposed solution

  1. Move destructive packaging/cleaning before all coverage-producing suites.
  2. Append execution data across the separate suite invocations.
  3. Assign a deterministic JaCoCo session ID to every suite.
  4. Generate one report-aggregate during a final verify invocation.
  5. Upload the exact module-local jacoco.xml file.
  6. Validate that the report contains every expected suite session, covered instructions, and
    expected module groups.
  7. Add hg-store-rocksdb as a direct dependency of the Store aggregate project.
  8. Upgrade PD/Store JaCoCo from 0.8.4 to 0.8.8 for Java 17 compatibility.

Scope

This issue covers repository-level PD/Store coverage collection, deterministic
aggregation/upload, and the minimum JaCoCo upgrade needed for Java 17 compatibility.

It does not require production-code changes, artificial coverage increases, Codecov
flags/carry-forward configuration, or a broader Codecov Action modernization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingci-cdBuild or deploy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions