aboutsummaryrefslogtreecommitdiff
path: root/python/run-tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/run-tests.py')
-rwxr-xr-xpython/run-tests.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/python/run-tests.py b/python/run-tests.py
index a9f8854e6f..38b3bb84c1 100755
--- a/python/run-tests.py
+++ b/python/run-tests.py
@@ -53,11 +53,25 @@ LOG_FILE = os.path.join(SPARK_HOME, "python/unit-tests.log")
FAILURE_REPORTING_LOCK = Lock()
LOGGER = logging.getLogger()
+# Find out where the assembly jars are located.
+for scala in ["2.11", "2.10"]:
+ build_dir = os.path.join(SPARK_HOME, "assembly", "target", "scala-" + scala)
+ if os.path.isdir(build_dir):
+ SPARK_DIST_CLASSPATH = os.path.join(build_dir, "jars", "*")
+ break
+else:
+ raise Exception("Cannot find assembly build directory, please build Spark first.")
+
def run_individual_python_test(test_name, pyspark_python):
env = dict(os.environ)
- env.update({'SPARK_TESTING': '1', 'PYSPARK_PYTHON': which(pyspark_python),
- 'PYSPARK_DRIVER_PYTHON': which(pyspark_python)})
+ env.update({
+ 'SPARK_DIST_CLASSPATH': SPARK_DIST_CLASSPATH,
+ 'SPARK_TESTING': '1',
+ 'SPARK_PREPEND_CLASSES': '1',
+ 'PYSPARK_PYTHON': which(pyspark_python),
+ 'PYSPARK_DRIVER_PYTHON': which(pyspark_python)
+ })
LOGGER.debug("Starting test(%s): %s", pyspark_python, test_name)
start_time = time.time()
try: