[SPARK-28701][INFRA][FOLLOWUP] Fix the key error when looking in os.environ

### What changes were proposed in this pull request?

i broke run-tests.py for non-PRB builds in this PR:
https://github.com/apache/spark/pull/25423

### Why are the changes needed?

to fix what i broke

### Does this PR introduce any user-facing change?
no

### How was this patch tested?
the build system will test this

Closes #25585 from shaneknapp/fix-run-tests.

Authored-by: shane knapp <incomplete@gmail.com>
Signed-off-by: shane knapp <incomplete@gmail.com>
This commit is contained in:
shane knapp 2019-08-26 12:40:31 -07:00
parent dd0725d7ea
commit 84d4f94596

View file

@ -405,10 +405,11 @@ def run_scala_tests(build_tool, hadoop_version, test_modules, excluded_tags):
test_profiles += ['-Dtest.exclude.tags=' + ",".join(excluded_tags)]
# set up java11 env if this is a pull request build with 'test-java11' in the title
if "test-java11" in os.environ["ghprbPullTitle"].lower():
os.environ["JAVA_HOME"] = "/usr/java/jdk-11.0.1"
os.environ["PATH"] = "%s/bin:%s" % (os.environ["JAVA_HOME"], os.environ["PATH"])
test_profiles += ['-Djava.version=11']
if "ghprbPullTitle" in os.environ:
if "test-java11" in os.environ["ghprbPullTitle"].lower():
os.environ["JAVA_HOME"] = "/usr/java/jdk-11.0.1"
os.environ["PATH"] = "%s/bin:%s" % (os.environ["JAVA_HOME"], os.environ["PATH"])
test_profiles += ['-Djava.version=11']
if build_tool == "maven":
run_scala_tests_maven(test_profiles)