[
https://issues.apache.org/jira/browse/HADOOP-15190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100075#comment-18100075
]
ASF GitHub Bot commented on HADOOP-15190:
-----------------------------------------
pan3793 commented on PR #8606:
URL: https://github.com/apache/hadoop/pull/8606#issuecomment-5118190752
Two issues, both in `hadoop-bos`. It appears to have been missed while its
sibling `hadoop-tos` was handled correctly.
## Bug 1 (build-breaking): `hadoop-bos` missing from the coverage aggregate
`hadoop-bos` is a test-bearing jar module (`<packaging>jar</packaging>` +
`src/test/java/`), but it is listed in neither `hadoop-coverage/pom.xml`'s
`<dependencies>` (the cloud-storage section lists `hadoop-cos`, `hadoop-gcp`,
`hadoop-huaweicloud`, `hadoop-tos`, but not `hadoop-bos`) nor
`coverage-modules-allowlist.txt`.
Running this PR's own `check-coverage-modules.sh` against the current tree
fails at `hadoop-coverage`'s `validate` phase:
```
check-coverage-modules: FAILED
The following test-bearing modules are missing from the coverage aggregate:
- hadoop-bos
```
So the documented command (`mvn verify -Djacoco.skip=false ...`) fails at
`hadoop-coverage` before `report-aggregate` ever runs, until `hadoop-bos` is
added as a `<dependency>` in `hadoop-coverage/pom.xml`.
## Bug 2 (silent coverage gap): `hadoop-bos` surefire argLine missing
`@{argLine}`
Even after Bug 1 is fixed,
`hadoop-cloud-storage-project/hadoop-bos/pom.xml:265` overrides surefire's
`<argLine>` without `@{argLine}`:
```xml
<argLine>${maven-surefire-plugin.argLine}</argLine>
```
A module-level `<argLine>` fully replaces the parent's, so the `@{argLine}`
token that `jacoco:prepare-agent` substitutes to inject the agent is dropped.
The forked test JVMs for `hadoop-bos` run without the JaCoCo agent, producing
no exec data, so its coverage shows as empty in the aggregate report, silently.
The guard script can't catch this; it only checks deps/allowlist presence.
Of the 21 surefire/failsafe `<argLine>` overrides in the repo, this PR
patched 20; `hadoop-bos` is the only one missed.
Fix for both:
```xml
<argLine>${maven-surefire-plugin.argLine} @{argLine}</argLine>
```
plus a `hadoop-bos` `<dependency>` entry in `hadoop-coverage/pom.xml`.
## Minor
The reorder of `maven-resources-plugin` after `exec-maven-plugin` in
`pluginManagement` (`hadoop-project/pom.xml`) is cosmetic only;
`pluginManagement` order has no effect in Maven.
> Use Jacoco to generate Unit Test coverage reports
> -------------------------------------------------
>
> Key: HADOOP-15190
> URL: https://issues.apache.org/jira/browse/HADOOP-15190
> Project: Hadoop Common
> Issue Type: Improvement
> Components: build
> Reporter: Duo Xu
> Assignee: Ferenc Erdelyi
> Priority: Minor
> Labels: pull-request-available
> Attachments: HADOOP-15190-design_2026_July_16.txt,
> HADOOP-15190.01.patch, aggregate_coverage_report_demo_2026_july_17.png,
> hadoop_nfs_jacoco_report_2026_july_17.png, jacoco_report_2018_01_25.JPG
>
>
> Currently Hadoop is using maven-clover2-plugin for code coverage, which is
> outdated. And Atlassian open-sourced clover last year so license cannot be
> purchased although we can switch to use the license-free version called
> "openclover".
> This Jira is to replace clover with Jacoco, which is actively maintained by
> the community.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]