[ 
https://issues.apache.org/jira/browse/HADOOP-15190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18100161#comment-18100161
 ] 

ASF GitHub Bot commented on HADOOP-15190:
-----------------------------------------

ferdelyi commented on PR #8606:
URL: https://github.com/apache/hadoop/pull/8606#issuecomment-5121062906

   > 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}`:
   > 
   > ```
   > <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:
   > 
   > ```
   > <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.
   
   Thanks @pan3793 — both are real, and they only surfaced once I rebased onto 
current trunk (hadoop-bos landed after this branch was originally cut). All 
three points are addressed in the latest push, which is rebased onto current 
trunk:
   
   Bug 1 (build-breaking): Added hadoop-bos as a <dependency> in 
hadoop-coverage/pom.xml, so it's part of the aggregate and the guard passes — 
check-coverage-modules: OK (72 test-bearing modules accounted for).
   
   Bug 2 (silent coverage gap): Appended @{argLine} to hadoop-bos/pom.xml's 
surefire <argLine>, matching every other argLine-overriding module, so 
jacoco:prepare-agent injects the agent. Confirmed on a small module that 
coverage is off by default and -Djacoco.skip=false produces target/jacoco.exec.
   
   Minor (reorder): Agreed, pluginManagement order is irrelevant — I've 
restored trunk's ordering (maven-resources-plugin before exec-maven-plugin) so 
hadoop-project/pom.xml carries no gratuitous diff.
   
   Separately, I extended check-coverage-modules.sh to catch the Bug 2 class 
going forward: it now fails the build at the validate phase if a test-bearing, 
non-allowlisted module overrides <argLine> without @{argLine} (verified it 
flags hadoop-bos when the token is removed). The structural fix that removes 
the footgun entirely — centralizing the argLine so a module can't drop 
@{argLine} — is tracked as a follow-up in HADOOP-19948.




> 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]

Reply via email to