Skip to content

Commit 4e70e67

Browse files
committed
Revert "Java: Make integration test more robust wrt recent Java versions."
This reverts commit ae21bbf.
1 parent ae21bbf commit 4e70e67

File tree

1 file changed

+7
-9
lines changed
  • java/ql/integration-tests/all-platforms/java/diagnostics/java-version-too-old

1 file changed

+7
-9
lines changed

java/ql/integration-tests/all-platforms/java/diagnostics/java-version-too-old/test.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
from diagnostics_test_utils import *
44

55
# Ensure we're using an old Java version that won't work with Gradle
6-
for java_home in ["JAVA_HOME_8_X64", "JAVA_HOME_8_arm64", "JAVA_HOME_8_ARM64"]:
7-
if java_home in os.environ:
8-
os.environ["JAVA_HOME"] = os.environ[java_home]
9-
sep = ";" if platform.system() == "Windows" else ":"
10-
os.environ["PATH"] = "".join([os.path.join(os.environ["JAVA_HOME"], "bin"), sep, os.environ["PATH"]])
11-
break
6+
if "JAVA_HOME_8_X64" in os.environ:
7+
os.environ["JAVA_HOME"] = os.environ["JAVA_HOME_8_X64"]
8+
sep = ";" if platform.system() == "Windows" else ":"
9+
os.environ["PATH"] = "".join([os.path.join(os.environ["JAVA_HOME"], "bin"), sep, os.environ["PATH"]])
1210

13-
# Ensure the autobuilder *doesn't* see newer Java versions, which it could switch to in order to build the project:
14-
for k in os.environ:
15-
if re.match(r"^JAVA_HOME_\d\d_", k):
11+
# Ensure the autobuilder *doesn't* see Java 11 or 17, which it could switch to in order to build the project:
12+
for k in ["JAVA_HOME_11_X64", "JAVA_HOME_17_X64"]:
13+
if k in os.environ:
1614
del os.environ[k]
1715

1816
# Use a custom, empty toolchains.xml file so the autobuilder doesn't see any Java versions that may be

0 commit comments

Comments
 (0)