← Back to Pull requests

Merge unit and smoke-test coverage in CI #531

Open
unknown opened this pull request with 313 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 28, 2026 22:38 UTC
Author

CI already ran the unit tests with JaCoCo (-Pcoverage=true), but the data stayed inside the Docker builder image. This PR exports it, records coverage of the server while the smoke tests run, and merges both into a single report, published as the Coverage Report artifact. Coverage is off on main, as before.

Changes


  • JaCoCo 0.8.8 → 0.8.14, now in the version catalog. The build stays on JDK 17, but the smoke-test images run Java 21, which 0.8.8 predates.

  • stageCoverage gathers the unit-test .exec files, the JaCoCo agent and the CLI into build/coverage. The Dockerfile exports that folder with the test results.

  • ci/coverage.compose.yml attaches the agent to the server when JACOCO_AGENT is set. configure-from-env splits VMOPTIONS on commas, so the agent gets only destfile and records every class. The report is limited to our own jars.

  • ci/run-configuration.sh stops the server with a 120s timeout before down, so the agent can write its data on shutdown. Java is PID 1 through the exec chain, so it receives the SIGTERM.

  • ci/coverage-report.sh merges all the data against the distribution jars the smoke tests ran. It fails if any of the inputs are missing.

  • Workflow: the build job uploads the unit data, each integration job uploads its smoke data, and a new coverage job merges them.

  • verification-metadata.xml regenerated on a cold cache with CI's flags.
  • Sonar


    ./gradlew sonar -Dsonar.host.url=... -Dsonar.token=... analyzes the project with the merged report (build/coverage/report/coverage.xml). The URL and token stay on the command line. Every module points at that report, because otherwise JaCoCo's per-module default overrides it. The project key defaults to oie and can be changed with -Dsonar.projectKey. SonarCloud also needs -Dsonar.organization.

    ci/coverage-report.sh now works on the local build layout, so anyone can produce the report (steps in ci/README.md). The CI job lays its artifacts out the same way.

    Testing


  • A cold-cache build dist stageCoverage -PdisableSigning=true -Pcoverage=true passes dependency verification.

  • Merging the unit data against the built jars gives zero class-ID mismatches.

  • A local server with the agent attached the same way writes valid data on SIGTERM. Merged with the unit data, line coverage rises from 13,136 to 15,854 of 128,212 lines, from server startup alone.
  • 🤖 Generated with Claude Code

    Diff: 313 lines (+234 / -79) across 3 files Reviewer: jonbartels Review duration: 28636m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 313 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.344
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #531"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.5% · Safe to merge
    21.5%