---
id: LSN-0044
ticket: jacoco-reports-consolidation
title: Jenkins Alignment with Consolidated JaCoCo Reports
created: 2026-04-07
tags:
  - infra
  - gradle
  - jacoco
  - jenkins
---

## Context

The Jenkins pipeline was still wired to an outdated coverage task and module-specific report paths. That made CI brittle after the project moved coverage reporting to the root-level consolidated `jacocoTestReport` task.

## Key Decisions

### Jenkins Reads Root-Level Coverage

**What:** Jenkins should run `./gradlew clean test jacocoTestReport` and publish coverage from the root project report directory.

**Why:** Coverage is aggregated across modules, so CI should not depend on a single application subproject path.

**Trade-offs:** The root task must run after all relevant tests. Jenkins paths must be rooted at the checkout workspace rather than a submodule directory.

## Patterns and Algorithms

The canonical report locations are:

- XML: `build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml`
- HTML: `build/reports/jacoco/jacocoTestReport/html`

Jenkins `recordCoverage` should consume the XML report. Jenkins `publishHTML` should expose the HTML directory.

## Pitfalls

- Do not point Jenkins at `SRS_APP/build/reports/...` or another module-local report when the project expects consolidated root coverage.
- Do not run only the reporting task without ensuring tests have executed first.
- Do not assume Jenkins relative paths start inside a Gradle subproject; treat the checkout root as the base.

## Takeaways

- Root-level coverage aggregation needs root-level CI report paths.
- The Jenkinsfile and Gradle coverage task names must move together.
