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

ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e73da2d904c [SPARK-54889][INFRA] Report test results to codecov
3e73da2d904c is described below

commit 3e73da2d904c03c4b4ce1515a62677d25b73cba7
Author: Tian Gao <[email protected]>
AuthorDate: Mon Jan 5 17:03:33 2026 +0800

    [SPARK-54889][INFRA] Report test results to codecov
    
    ### What changes were proposed in this pull request?
    
    Upload test reports to Codecov.io for all main commits to have a nice 
dashboard to check test flakyness and performance.
    
    ### Why are the changes needed?
    
    Currently we have no insights into our tests. We don't know if a test is 
flaky, when a test has been failing or how long a test takes.
    
    Codecov is a free solution and we are using it for coverage report already. 
It will produce something like
    <img width="3410" height="1282" alt="image" 
src="https://github.com/user-attachments/assets/62850101-3f31-463e-94dd-0f8dcbb146fc";
 />
    
    and it's much much better than nothing.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    I tried to enable it on PR and generated the dashboard above on my own 
repo. The syntax should be correct but we only want data from master for now.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #53665 from gaogaotiantian/report-tests-to-codecov.
    
    Authored-by: Tian Gao <[email protected]>
    Signed-off-by: Ruifeng Zheng <[email protected]>
---
 .github/workflows/build_and_test.yml | 9 +++++++++
 .github/workflows/build_main.yml     | 7 +++++++
 dev/run-pip-tests                    | 4 ++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build_and_test.yml 
b/.github/workflows/build_and_test.yml
index aa7c72756305..a0ada6ce7497 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -653,6 +653,15 @@ jobs:
         flags: unittests
         name: PySpark
         verbose: true
+    - name: Upload test results to Codecov
+      if: (!cancelled()) && fromJSON(inputs.envs).PYSPARK_CODECOV_TEST == 
'true'
+      uses: codecov/codecov-action@v5
+      with:
+        report_type: 'test_results'
+        files: '**/target/test-reports/*.xml'
+        flags: unittests
+        name: PySpark-Test-Results
+        token: ${{ secrets.codecov_token }}
     - name: Upload test results to report
       env: ${{ fromJSON(inputs.envs) }}
       if: always()
diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml
index 97c19d92eeae..a48dfdd5c1fa 100644
--- a/.github/workflows/build_main.yml
+++ b/.github/workflows/build_main.yml
@@ -30,5 +30,12 @@ jobs:
       packages: write
     name: Run
     uses: ./.github/workflows/build_and_test.yml
+    with:
+      envs: >-
+        {
+          "PYSPARK_IMAGE_TO_TEST": "python-311",
+          "PYTHON_TO_TEST": "python3.11",
+          "PYSPARK_CODECOV_TEST": "true"
+        }
     secrets:
       codecov_token: ${{ secrets.CODECOV_TOKEN }}
diff --git a/dev/run-pip-tests b/dev/run-pip-tests
index 233eaed7ff24..e0c519336947 100755
--- a/dev/run-pip-tests
+++ b/dev/run-pip-tests
@@ -28,9 +28,9 @@ cd "$FWDIR"
 # Clean ignored/untracked files that do not need
 # for pip packaging test. Machines in GitHub Action do not have
 # enough space, see also SPARK-44557.
-# We need to keep the coverage file from previous tests in coverage runs.
+# We need to keep the coverage and test report from previous tests in coverage 
runs.
 if [[ ! -z "${GITHUB_ACTIONS}" ]]; then
-  git clean -d -f -x -e assembly -e python/coverage.xml
+  git clean -d -f -x -e assembly -e python/coverage.xml -e target/test-reports/
 fi
 
 echo "Constructing virtual env for testing"


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

Reply via email to