voonhous commented on code in PR #19933:
URL: https://github.com/apache/hudi/pull/19933#discussion_r4625019273


##########
scripts/jacoco/merge_jacoco_exec_files.sh:
##########
@@ -18,13 +18,18 @@
 # under the License.
 #
 /bin/bash --version
-shopt -s globstar
+# nullglob drops a directory with no exec files instead of passing its pattern 
to merge.
+shopt -s globstar nullglob
 echo "Jacoco CLI jar: $1"
-echo "Hudi source directory: $2"
+echo "Hudi source directories: ${*:2}"
+exec_files=()
+for dir in "${@:2}"; do
+  exec_files+=($dir/**/jacoco-agent/**/*.exec)
+done
 retry_count=0
 while [[ $retry_count -lt 3 ]]; do
-  ls -l $2/**/jacoco-agent/**/*.exec
-  java -jar $1 merge $2/**/jacoco-agent/**/*.exec --destfile merged-jacoco.exec
+  ls -l "${exec_files[@]}"
+  java -jar $1 merge "${exec_files[@]}" --destfile merged-jacoco.exec

Review Comment:
   Fixed: `merge_jacoco_exec_files.sh` now exits 1 with the directories it 
searched when `exec_files` is empty, before calling JaCoCo. It also exits 1 
once its three retries fail; before, the loop fell through and the script 
returned 0.
   



##########
.github/workflows/bot.yml:
##########
@@ -335,7 +342,7 @@ jobs:
         if: always() && github.event_name != 'merge_group'
         uses: ./.github/actions/upload-coverage
         with:
-          flags: utilities
+          flags: utilities,hadoop-mr-java-client

Review Comment:
   Fixed:
   
   - **Scope:** the `hadoop-mr-java-client` report step lists the modules of 
the old job's reactor (`-am -pl hudi-hadoop-mr,hudi-client/hudi-java-client` 
through `exec:exec` with `pwd`) and passes them in a new optional 
`COVERAGE_MODULE_DIRS`. Only those modules' `target/classes` and 
`src/main/{java,scala}` go into the report.
   - **Aggregate dirs:** `generate_merged_coverage_report.sh` now recreates 
`aggregate-classes` and `aggregate-sources` on every call.
   
   The `utilities` report keeps the whole workspace: `-am -pl hudi-utilities` 
resolves to the same reactor as the combined build.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to