From e535d4467e383323612de5bc51b1f4b03f7a66e6 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 14 Jan 2019 13:04:59 +0000 Subject: [PATCH] Allow user to control Java version used by tox This allows user to define JAVA_HOME in order to control which version of Java will be used by Gerrit during tox testing. Avoid Gerrit startup failure due to use of wrong version of Java, even if `java -version` would have reported the right version. On systems with multiple versions of Java 8/9/10 it was impossible to run tox because the launcher would have always picked the latest version which is clearly not compatible with Gerrit war archive used for testing. In the future we will start using a gerrit container for testing and avoid dependency on local Java version. Change-Id: I05b6f7125393a009e1fdcf556b17df158c10eea0 --- tox.ini | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 52b315b1..7c63f917 100644 --- a/tox.ini +++ b/tox.ini @@ -4,8 +4,14 @@ envlist = pep8,docs,py27,py3{4,5,6,7} [testenv] # See "testing behind a proxy" # @ https://review.openstack.org/#/q/I764ed51314c8e2d0572d1f0 -passenv = http_proxy https_proxy -# passenv = http_proxy https_proxy _JAVA_OPTIONS +passenv = + http_proxy + https_proxy + # avoids potential slip-over of java 1.9 which breaks Gerrit, without it + # Gerrit may start with incompatible java version. + JAVA_HOME + # uncomment to allow custom java options to be added + # _JAVA_OPTIONS commands = python -m git_review.tests.check_test_id_hashes discover --list