You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2021/07/22 02:48:17 UTC

[spark] branch branch-3.2 updated: [SPARK-36251][INFRA][BUILD][3.2] Cover GitHub Actions runs without SHA in testing script

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

gurwls223 pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new d01e532  [SPARK-36251][INFRA][BUILD][3.2] Cover GitHub Actions runs without SHA in testing script
d01e532 is described below

commit d01e53208b75f14be80097b7cd8667bf0122acfc
Author: Hyukjin Kwon <gu...@apache.org>
AuthorDate: Thu Jul 22 11:47:36 2021 +0900

    [SPARK-36251][INFRA][BUILD][3.2] Cover GitHub Actions runs without SHA in testing script
    
    ### What changes were proposed in this pull request?
    
    This PR partially backports the fix in the script at https://github.com/apache/spark/pull/33410 to make the branch-3.2 build pass at https://github.com/apache/spark/actions/workflows/build_and_test.yml?query=event%3Aschedule
    
    ### Why are the changes needed?
    
    To make the Scala 2.13 periodical job pass
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, dev-only.
    
    ### How was this patch tested?
    
    It is a logically non-conflicting backport.
    
    Closes #33472 from HyukjinKwon/SPARK-36251.
    
    Authored-by: Hyukjin Kwon <gu...@apache.org>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 dev/run-tests.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/dev/run-tests.py b/dev/run-tests.py
index 2f05077..def0948 100755
--- a/dev/run-tests.py
+++ b/dev/run-tests.py
@@ -693,15 +693,19 @@ def main():
     included_tags = []
     excluded_tags = []
     if should_only_test_modules:
+        # We're likely in the forked repository
+        is_apache_spark_ref = os.environ.get("APACHE_SPARK_REF", "") != ""
+        # We're likely in the main repo build.
+        is_github_prev_sha = os.environ.get("GITHUB_PREV_SHA", "") != ""
+        # Otherwise, we're in either periodic job in Github Actions or somewhere else.
+
         # If we're running the tests in GitHub Actions, attempt to detect and test
         # only the affected modules.
-        if test_env == "github_actions":
-            if "APACHE_SPARK_REF" in os.environ and os.environ["APACHE_SPARK_REF"] != "":
-                # Fork repository
+        if test_env == "github_actions" and (is_apache_spark_ref or is_github_prev_sha):
+            if is_apache_spark_ref:
                 changed_files = identify_changed_files_from_git_commits(
                     "HEAD", target_ref=os.environ["APACHE_SPARK_REF"])
-            else:
-                # Build for each commit.
+            elif is_github_prev_sha:
                 changed_files = identify_changed_files_from_git_commits(
                     os.environ["GITHUB_SHA"], target_ref=os.environ["GITHUB_PREV_SHA"])
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org