Skip to content

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

Merged
imbajin merged 7 commits into
apache:masterfrom
contrueCT:task/fix-jacoco-codecov-aggregation
Aug 24, 2026
Merged

fix(ci): preserve PD and Store coverage aggregation#3161
imbajin merged 7 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 selected PD/Store test
    profile and verify the complete expected session set before upload.
  • Require at least one non-skipped Surefire test for every selected suite.
    Exclude the existing Store core/server placeholder suites from the coverage
    gate until they contain real tests.
  • Generate one aggregate XML report during verify and upload that exact file
    to Codecov.
  • Parse the aggregate JaCoCo XML structurally, rejecting malformed XML and
    comment-only evidence while accepting valid attribute reordering.
  • Require non-zero instruction coverage for the instrumented PD common/client/
    core groups and Store common/client/RocksDB groups. Keep zero-class and
    externally executed aggregate dependencies as presence-only checks.
  • 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 validator and contract tests for malformed arguments, missing reports,
    zero-test and all-skipped suites, malformed and spoofed XML, reordered
    attributes, uncovered reports and individual required groups, missing
    sessions/modules, Maven lifecycle bindings, dependency scope, exact workflow
    inputs, and timeout behavior without GNU coreutils.

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 and all changed POMs.
    • 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 four-suite PD/four-suite 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
Comment thread hugegraph-server/hugegraph-dist/src/assembly/travis/check-jacoco-report.sh Outdated
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

@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 coverage workflow now exercises the intended PD/Store profiles and produces aggregate reports, but the validator still permits false-positive coverage evidence in two paths. Evidence: exact-head CI is green, while the findings below concern the validator's acceptance criteria and local contract portability.

Comment thread .github/workflows/pd-store-ci.yml Outdated
Comment thread hugegraph-server/hugegraph-dist/src/assembly/travis/check-jacoco-report.sh Outdated
Comment thread hugegraph-server/hugegraph-dist/src/assembly/travis/check-jacoco-report.sh Outdated
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.66%. Comparing base (431f6e6) to head (a63e48e).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3161      +/-   ##
============================================
- Coverage     41.06%   38.66%   -2.40%     
- Complexity      519      553      +34     
============================================
  Files           771      735      -36     
  Lines         65962    63318    -2644     
  Branches       8766     8431     -335     
============================================
- Hits          27088    24485    -2603     
- Misses        36008    36106      +98     
+ Partials       2866     2727     -139     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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 current coverage gate still accepts an all-skipped suite, and the new validator contract harness is not portable to stock macOS. Evidence: exact-head validator/workflow diff, Surefire parsing at check-jacoco-report.sh:98-110, and the contract harness timeout invocation.

Comment thread hugegraph-server/hugegraph-dist/src/assembly/travis/test-check-jacoco-report.sh Outdated

@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.

It's important to point out the critical CI issue to ensure the test coverage & code quality

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 24, 2026
@github-project-automation github-project-automation Bot moved this from In progress to In review in HugeGraph PD-Store Tasks Aug 24, 2026
@imbajin
imbajin merged commit 5db70c0 into apache:master Aug 24, 2026
18 of 19 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in HugeGraph PD-Store Tasks Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Build or deploy lgtm This PR has been approved by a maintainer pd PD module size:XL This PR changes 500-999 lines, ignoring generated files. store Store module

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

2 participants