From 8f65ed088d1b3df22e7d364de8c23f0b034c171f Mon Sep 17 00:00:00 2001 From: Josh Rosen Date: Fri, 26 Jun 2015 12:02:04 -0700 Subject: [PATCH] Fix handling of module in python/run-tests --- dev/run-tests.py | 9 +++++---- python/run-tests.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dev/run-tests.py b/dev/run-tests.py index 87218e3eea704..edf669e73591b 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -360,12 +360,13 @@ def run_scala_tests(build_tool, hadoop_version, test_modules): run_scala_tests_sbt(test_modules, test_profiles) -def run_python_tests(modules): +def run_python_tests(test_modules): set_title_and_block("Running PySpark tests", "BLOCK_PYSPARK_UNIT_TESTS") - run_cmd([ - os.path.join(SPARK_HOME, "python", "run-tests"), - "--modules=%s" % ','.join(m.name for m in modules)]) + command = [os.path.join(SPARK_HOME, "python", "run-tests")] + if test_modules != [modules.root]: + command.append("--modules=%s" % ','.join(m.name for m in modules)) + run_cmd(command) def run_sparkr_tests(): diff --git a/python/run-tests.py b/python/run-tests.py index 297ba22e99619..6d188019f8713 100755 --- a/python/run-tests.py +++ b/python/run-tests.py @@ -35,7 +35,7 @@ from sparktestsupport.modules import all_modules # noqa -python_modules = dict((m.name, m) for m in all_modules if m.python_test_goals) +python_modules = dict((m.name, m) for m in all_modules if m.python_test_goals if m.name != 'root') def print_red(text): @@ -85,7 +85,7 @@ def parse_opts(): ) parser.add_option( "--modules", type="string", - default=",".join(sorted(set(python_modules.keys()) - set(['root']))), + default=",".join(sorted(python_modules.keys())), help="A comma-separated list of Python modules to test (default: %default)" )