Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions dev/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down