HyukjinKwon commented on a change in pull request #29086:
URL: https://github.com/apache/spark/pull/29086#discussion_r453572801
##########
File path: dev/run-tests.py
##########
@@ -589,43 +627,74 @@ def main():
# /home/jenkins/anaconda2/envs/py36/bin
os.environ["PATH"] = "/home/anaconda/envs/py36/bin:" +
os.environ.get("PATH")
else:
- # else we're running locally and can use local settings
+ # else we're running locally or Github Actions.
build_tool = "sbt"
hadoop_version = os.environ.get("HADOOP_PROFILE", "hadoop2.7")
hive_version = os.environ.get("HIVE_PROFILE", "hive2.3")
- test_env = "local"
+ if "GITHUB_ACTIONS" in os.environ:
+ test_env = "github_actions"
+ else:
+ test_env = "local"
print("[info] Using build tool", build_tool, "with Hadoop profile",
hadoop_version,
"and Hive profile", hive_version, "under environment", test_env)
extra_profiles = get_hadoop_profiles(hadoop_version) +
get_hive_profiles(hive_version)
changed_modules = None
+ test_modules = None
changed_files = None
- should_only_test_modules = "TEST_ONLY_MODULES" in os.environ
+ should_only_test_modules = opts.modules is not None
included_tags = []
+ excluded_tags = []
if should_only_test_modules:
- str_test_modules = [m.strip() for m in
os.environ.get("TEST_ONLY_MODULES").split(",")]
+ str_test_modules = [m.strip() for m in opts.modules.split(",")]
test_modules = [m for m in modules.all_modules if m.name in
str_test_modules]
- # Directly uses test_modules as changed modules to apply tags and
environments
- # as if all specified test modules are changed.
+
+ # If we're running the tests in Github Actions, attempt to detect and
test
+ # only the affected modules.
+ if test_env == "github_actions":
+ if os.environ["GITHUB_BASE_REF"] != "":
Review comment:
`GITHUB_BASE_REF` is only set in the PR builder; otherwise, it's an
empty string.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]