Skip to content

Commit d01e532

Browse files
committed
[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 #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 <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent fef7bf9 commit d01e532

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dev/run-tests.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,15 +693,19 @@ def main():
693693
included_tags = []
694694
excluded_tags = []
695695
if should_only_test_modules:
696+
# We're likely in the forked repository
697+
is_apache_spark_ref = os.environ.get("APACHE_SPARK_REF", "") != ""
698+
# We're likely in the main repo build.
699+
is_github_prev_sha = os.environ.get("GITHUB_PREV_SHA", "") != ""
700+
# Otherwise, we're in either periodic job in Github Actions or somewhere else.
701+
696702
# If we're running the tests in GitHub Actions, attempt to detect and test
697703
# only the affected modules.
698-
if test_env == "github_actions":
699-
if "APACHE_SPARK_REF" in os.environ and os.environ["APACHE_SPARK_REF"] != "":
700-
# Fork repository
704+
if test_env == "github_actions" and (is_apache_spark_ref or is_github_prev_sha):
705+
if is_apache_spark_ref:
701706
changed_files = identify_changed_files_from_git_commits(
702707
"HEAD", target_ref=os.environ["APACHE_SPARK_REF"])
703-
else:
704-
# Build for each commit.
708+
elif is_github_prev_sha:
705709
changed_files = identify_changed_files_from_git_commits(
706710
os.environ["GITHUB_SHA"], target_ref=os.environ["GITHUB_PREV_SHA"])
707711

0 commit comments

Comments
 (0)