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
This commit is contained in:
Sorin Sbarnea 2019-01-14 13:04:59 +00:00
parent afa54af210
commit e535d4467e
1 changed files with 8 additions and 2 deletions

10
tox.ini
View File

@ -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