aboutsummaryrefslogtreecommitdiff
path: root/dev/run-tests.py
diff options
context:
space:
mode:
authorMarcelo Vanzin <vanzin@cloudera.com>2015-10-07 14:11:21 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2015-10-07 14:11:21 -0700
commit94fc57afdf8ac6be35f13956232b6cf58857d047 (patch)
tree359e0d84ca87242bebb8e933afc0ff9847612783 /dev/run-tests.py
parenta9ecd06149df4ccafd3927c35f63b9f03f170ae5 (diff)
downloadspark-94fc57afdf8ac6be35f13956232b6cf58857d047.tar.gz
spark-94fc57afdf8ac6be35f13956232b6cf58857d047.tar.bz2
spark-94fc57afdf8ac6be35f13956232b6cf58857d047.zip
[SPARK-10300] [BUILD] [TESTS] Add support for test tags in run-tests.py.
Author: Marcelo Vanzin <vanzin@cloudera.com> Closes #8775 from vanzin/SPARK-10300.
Diffstat (limited to 'dev/run-tests.py')
-rwxr-xr-xdev/run-tests.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/dev/run-tests.py b/dev/run-tests.py
index d8b22e1665..1a81658518 100755
--- a/dev/run-tests.py
+++ b/dev/run-tests.py
@@ -118,6 +118,14 @@ def determine_modules_to_test(changed_modules):
return modules_to_test.union(set(changed_modules))
+def determine_tags_to_exclude(changed_modules):
+ tags = []
+ for m in modules.all_modules:
+ if m not in changed_modules:
+ tags += m.test_tags
+ return tags
+
+
# -------------------------------------------------------------------------------------------------
# Functions for working with subprocesses and shell tools
# -------------------------------------------------------------------------------------------------
@@ -369,6 +377,7 @@ def detect_binary_inop_with_mima():
def run_scala_tests_maven(test_profiles):
mvn_test_goals = ["test", "--fail-at-end"]
+
profiles_and_goals = test_profiles + mvn_test_goals
print("[info] Running Spark tests using Maven with these arguments: ",
@@ -392,7 +401,7 @@ def run_scala_tests_sbt(test_modules, test_profiles):
exec_sbt(profiles_and_goals)
-def run_scala_tests(build_tool, hadoop_version, test_modules):
+def run_scala_tests(build_tool, hadoop_version, test_modules, excluded_tags):
"""Function to properly execute all tests passed in as a set from the
`determine_test_suites` function"""
set_title_and_block("Running Spark unit tests", "BLOCK_SPARK_UNIT_TESTS")
@@ -401,6 +410,10 @@ def run_scala_tests(build_tool, hadoop_version, test_modules):
test_profiles = get_hadoop_profiles(hadoop_version) + \
list(set(itertools.chain.from_iterable(m.build_profile_flags for m in test_modules)))
+
+ if excluded_tags:
+ test_profiles += ['-Dtest.exclude.tags=' + ",".join(excluded_tags)]
+
if build_tool == "maven":
run_scala_tests_maven(test_profiles)
else:
@@ -500,8 +513,10 @@ def main():
target_branch = os.environ["ghprbTargetBranch"]
changed_files = identify_changed_files_from_git_commits("HEAD", target_branch=target_branch)
changed_modules = determine_modules_for_files(changed_files)
+ excluded_tags = determine_tags_to_exclude(changed_modules)
if not changed_modules:
changed_modules = [modules.root]
+ excluded_tags = []
print("[info] Found the following changed modules:",
", ".join(x.name for x in changed_modules))
@@ -541,7 +556,7 @@ def main():
detect_binary_inop_with_mima()
# run the test suites
- run_scala_tests(build_tool, hadoop_version, test_modules)
+ run_scala_tests(build_tool, hadoop_version, test_modules, excluded_tags)
modules_with_python_tests = [m for m in test_modules if m.python_test_goals]
if modules_with_python_tests: