This is an automated email from the ASF dual-hosted git repository.

sarutak pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new 3d474702ea9e [SPARK-57692][INFRA] Skip test report when no test 
results exist
3d474702ea9e is described below

commit 3d474702ea9ea2686c19eb27d9950f76095a1094
Author: Kousuke Saruta <[email protected]>
AuthorDate: Sat Jun 27 18:55:56 2026 +0900

    [SPARK-57692][INFRA] Skip test report when no test results exist
    
    ### What changes were proposed in this pull request?
    
    This PR adds a check in `test_report.yml` to skip the test report 
publishing step when no test result XML files are found after downloading 
artifacts.
    
    ### Why are the changes needed?
    When a commit only modifies files in the `dev-tools` module (e.g., 
`LICENSE-binary`), no build or tests are executed. However, the "Report test 
results" workflow still triggers on the Build workflow's completion and fails 
with "No test results found!" because there are no test artifacts to report on.
    
    * https://github.com/apache/spark/runs/83376805611
    * https://github.com/apache/spark/runs/83376713136
    * https://github.com/apache/spark/runs/83376067066
    
    SPARK-55594 (78ab6e2e2f) previously addressed the same "No test results 
found!" error for the `pages.yml` case by filtering out that specific workflow 
path. However, the `dev-tools` module case was not covered. This PR takes a 
more general approach by checking for the actual presence of test result files, 
which handles all cases where tests are legitimately not executed, including 
any future ones.
    
    Note: The existing `pages.yml` filter in the job's `if` condition is 
intentionally kept. It avoids spinning up the job entirely for a known no-op 
case, saving runner resources.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    Self review. Also, this will be validated by observing that commits which 
only modify files in the `dev-tools` module (e.g., `LICENSE-binary`, 
`README.md`, `.gitignore`) no longer produce a failed "Report test results" 
check.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Kiro CLI / Claude
    
    Closes #56769 from sarutak/fix-test-report-no-results.
    
    Authored-by: Kousuke Saruta <[email protected]>
    Signed-off-by: Kousuke Saruta <[email protected]>
    (cherry picked from commit f5e990005dde3aa24241b97f4498449ca68e94a5)
    Signed-off-by: Kousuke Saruta <[email protected]>
---
 .github/workflows/test_report.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/.github/workflows/test_report.yml 
b/.github/workflows/test_report.yml
index 62b4e0d2e9fd..2640803bf9f6 100644
--- a/.github/workflows/test_report.yml
+++ b/.github/workflows/test_report.yml
@@ -41,7 +41,17 @@ jobs:
         github-token: ${{ secrets.GITHUB_TOKEN }}
         run-id: ${{ github.event.workflow_run.id }}
         pattern: "test-*"
+    - name: Check if test results exist
+      id: check
+      run: |
+        if find . -path '*/target/test-reports/*.xml' -print -quit | grep -q 
.; then
+          echo "has_results=true" >> $GITHUB_OUTPUT
+        else
+          echo "No test result files found. Skipping report."
+          echo "has_results=false" >> $GITHUB_OUTPUT
+        fi
     - name: Publish test report
+      if: steps.check.outputs.has_results == 'true'
       uses: 
scacap/action-surefire-report@5609ce4db72c09db044803b344a8968fd1f315da
       with:
         check_name: Report test results


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to