Skip to content

Conversation

@millerjp
Copy link
Contributor

Summary

Adds JaCoCo code coverage with baseline threshold enforcement and CI integration.

Changes

JaCoCo Configuration:

  • JaCoCo Maven Plugin 0.8.11
  • Measures coverage from BOTH unit and integration tests (combined)
  • Merges coverage data: jacoco.exec + jacoco-it.exec → jacoco-merged.exec
  • Generates HTML report in target/site/jacoco/
  • Enforces 67% line coverage minimum (current baseline)
  • Build fails if coverage drops below threshold

Current Coverage (Combined):

  • Line Coverage: 67% (1,123 of 1,676 lines)
  • Instruction Coverage: 67%
  • Branch Coverage: 53%

By Package:

  • com.axonops.libre2.api: 65%
  • com.axonops.libre2.cache: 67%
  • com.axonops.libre2.jni: 70%
  • com.axonops.libre2.metrics: 85%
  • com.axonops.libre2.dropwizard: 80%
  • com.axonops.libre2.util: 68%

CI Pipeline Updates:

  • Renamed unit-testscore-tests
  • Stage 2 now runs: mvn verify -pl libre2-core (unit + integration + coverage)
  • Uploads JaCoCo HTML report as artifact (30 day retention)
  • Removed Ubuntu 24.04 x86_64 from integration stage (redundant)
  • Total jobs reduced: 20 → 19

New Pipeline Structure:

Stage 1: Build JAR
Stage 2: Core Tests (unit + integration + coverage, Ubuntu 24.04) ← UPDATED
Stage 3: Integration Tests (6 platforms, skip Ubuntu 24)
Stage 4: Performance Tests (7 platforms)
Stage 5: ARM64 Final Validation (3 platforms)

Benefits

  1. ✅ Enforces coverage baseline (prevents regression)
  2. ✅ Combined coverage (unit + integration) for full picture
  3. ✅ Fast feedback in stage 2 (~18s)
  4. ✅ Coverage report available as CI artifact
  5. ✅ One less redundant job (Ubuntu 24 not duplicated)

Testing

  • ✅ All 450 tests passing (22 unit + 428 integration)
  • ✅ Coverage check passing (67.0% ≥ 67.0%)
  • ✅ CI validation in progress

Ready to merge after CI passes

Configuration:
- JaCoCo Maven Plugin 0.8.11
- Measures coverage from BOTH unit tests and integration tests
- Merges jacoco.exec + jacoco-it.exec → jacoco-merged.exec
- Generates combined HTML report in target/site/jacoco/
- Enforces minimum 67% line coverage (current baseline)

Current Coverage (Combined Unit + Integration):
- Line Coverage: 67% (1,676 lines total)
- Instruction Coverage: 67%
- Branch Coverage: 53%

Coverage by Package:
- com.axonops.libre2.api: 65% (Pattern, Matcher, RE2, MatchResult)
- com.axonops.libre2.cache: 67% (PatternCache, IdleEvictionTask, etc.)
- com.axonops.libre2.jni: 70% (RE2Native, IRE2Native, RE2LibraryLoader)
- com.axonops.libre2.metrics: 85% (Metrics adapters)
- com.axonops.libre2.dropwizard: 80% (RE2MetricsConfig)
- com.axonops.libre2.util: 68% (Utilities)

Build fails if coverage drops below 67%, preventing regression.
Changes:
- Rename unit-tests job → core-tests
- Run mvn verify (unit + integration + coverage) on Ubuntu 24.04
- Upload JaCoCo coverage report as artifact (30 day retention)
- Remove integration-linux-ubuntu-2404-x86_64 job (redundant - already ran in core-tests)
- Update all job dependencies: unit-tests → core-tests

New Pipeline Structure:
- Stage 1: Build JAR (ubuntu-latest)
- Stage 2: Core Tests (unit + integration + coverage check, Ubuntu 24.04) ← UPDATED
- Stage 3: Integration Tests (6 platforms: macOS x2, Ubuntu 20/22, Rocky 8/9)
- Stage 4: Performance Tests (7 platforms: adds macOS aarch64)
- Stage 5: ARM64 Final Validation (3 QEMU platforms)

Benefits:
- Fast coverage feedback in stage 2 (~18s)
- Fails early if coverage drops below 67%
- Coverage report available as CI artifact
- Ubuntu 24.04 not duplicated in integration stage
- One less job to run (19 jobs instead of 20)
@millerjp millerjp merged commit 4120c7b into main Nov 27, 2025
38 checks passed
@millerjp millerjp deleted the feature/code-coverage branch November 27, 2025 17:06
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.

2 participants