aboutsummaryrefslogtreecommitdiff
path: root/dev/run-tests.py
diff options
context:
space:
mode:
authorfe2s <aka.fe2s@gmail.com>2015-06-24 15:12:23 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-06-24 15:12:23 -0700
commitdca21a83ac33813dd8165acb5f20d06e4f9b9034 (patch)
treeb99efe419971549403e60385cec66f1536b6dd2c /dev/run-tests.py
parent8ab50765cd793169091d983b50d87a391f6ac1f4 (diff)
downloadspark-dca21a83ac33813dd8165acb5f20d06e4f9b9034.tar.gz
spark-dca21a83ac33813dd8165acb5f20d06e4f9b9034.tar.bz2
spark-dca21a83ac33813dd8165acb5f20d06e4f9b9034.zip
[SPARK-8558] [BUILD] Script /dev/run-tests fails when _JAVA_OPTIONS env var set
Author: fe2s <aka.fe2s@gmail.com> Author: Oleksiy Dyagilev <oleksiy_dyagilev@epam.com> Closes #6956 from fe2s/fix-run-tests and squashes the following commits: 31b6edc [fe2s] str is a built-in function, so using it as a variable name will lead to spurious warnings in some Python linters 7d781a0 [fe2s] fixing for openjdk/IBM, seems like they have slightly different wording, but all have 'version' word. Surrounding with spaces for the case if version word appears in _JAVA_OPTIONS cd455ef [fe2s] address comment, looking for java version string rather than expecting to have on a certain line number ad577d7 [Oleksiy Dyagilev] [SPARK-8558][BUILD] Script /dev/run-tests fails when _JAVA_OPTIONS env var set
Diffstat (limited to 'dev/run-tests.py')
-rwxr-xr-xdev/run-tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/dev/run-tests.py b/dev/run-tests.py
index de1b4537ed..e7c09b0f40 100755
--- a/dev/run-tests.py
+++ b/dev/run-tests.py
@@ -477,7 +477,12 @@ def determine_java_version(java_exe):
raw_output = subprocess.check_output([java_exe, "-version"],
stderr=subprocess.STDOUT)
- raw_version_str = raw_output.split('\n')[0] # eg 'java version "1.8.0_25"'
+
+ raw_output_lines = raw_output.split('\n')
+
+ # find raw version string, eg 'java version "1.8.0_25"'
+ raw_version_str = next(x for x in raw_output_lines if " version " in x)
+
version_str = raw_version_str.split()[-1].strip('"') # eg '1.8.0_25'
version, update = version_str.split('_') # eg ['1.8.0', '25']