diff options
author | 2018-01-02 08:04:03 -0800 | |
---|---|---|
committer | 2018-01-02 08:05:27 -0800 | |
commit | a3fd5e76be71988035388c7e09c3257c8cbb2dd3 (patch) | |
tree | f4fe262078f1707a832ad50018ee6c9764483da5 | |
parent | defba586cde9435478d13d33225c2c643b58268f (diff) |
test: use bazel_with_jdk in py integration test
This change avoids the need to inject the user's
JAVA_HOME into the test, or to discover the JDK's
location on Windows.
Change-Id: Icec2f23ff61d52406eabe36367130d00535d8764
PiperOrigin-RevId: 180547577
-rw-r--r-- | src/test/py/bazel/BUILD | 2 | ||||
-rw-r--r-- | src/test/py/bazel/test_base.py | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/test/py/bazel/BUILD b/src/test/py/bazel/BUILD index 4198b90f44..9b989ef53e 100644 --- a/src/test/py/bazel/BUILD +++ b/src/test/py/bazel/BUILD @@ -9,7 +9,7 @@ filegroup( filegroup( name = "test-deps", testonly = 1, - srcs = ["//src:bazel"], + srcs = ["//src:bazel_with_jdk"], ) py_library( diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py index 9eb763dd77..8cae0d9490 100644 --- a/src/test/py/bazel/test_base.py +++ b/src/test/py/bazel/test_base.py @@ -188,7 +188,7 @@ class TestBase(unittest.TestCase): (int, [string], [string]) tuple: exit code, stdout lines, stderr lines """ return self.RunProgram([ - self.Rlocation('io_bazel/src/bazel'), + self.Rlocation('io_bazel/src/bazel_with_jdk'), '--bazelrc=/dev/null', '--nomaster_bazelrc', ] + args, env_remove, env_add) @@ -249,14 +249,17 @@ class TestBase(unittest.TestCase): os.path.walk('c:\\program files\\java\\', _Visit, result) env = { - 'SYSTEMROOT': TestBase.GetEnv('SYSTEMROOT'), - # TODO(laszlocsomor): Let Bazel pass BAZEL_SH and JAVA_HOME to tests - # and use those here instead of hardcoding paths. - 'JAVA_HOME': 'c:\\program files\\java\\' + sorted(result)[-1], - 'BAZEL_SH': 'c:\\tools\\msys64\\usr\\bin\\bash.exe', + 'SYSTEMROOT': + TestBase.GetEnv('SYSTEMROOT'), + # TODO(laszlocsomor): Let Bazel pass BAZEL_SH to tests and use that + # here instead of hardcoding paths. + 'BAZEL_SH': + TestBase.GetEnv('BAZEL_SH', + 'c:\\tools\\msys64\\usr\\bin\\bash.exe'), # TODO(pcloudy): Remove this after no longer need to debug # https://github.com/bazelbuild/bazel/issues/3273 - 'CC_CONFIGURE_DEBUG': '1' + 'CC_CONFIGURE_DEBUG': + '1' } else: env = {'HOME': os.path.join(self._temp, 'home')} |