Skip to content

Commit f5b04ab

Browse files
authored
Merge pull request github#13187 from github/mbg/java/fix-java-version-too-old-more
Java: Use empty toolchains.xml for the `java-version-too-old` test
2 parents 9954542 + 2d80302 commit f5b04ab

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
if k in os.environ:
1414
del os.environ[k]
1515

16-
run_codeql_database_create([], lang="java", runFunction = runUnsuccessfully, db = None)
16+
# Use a custom, empty toolchains.xml file so the autobuilder doesn't see any Java versions that may be
17+
# in a system-level toolchains file
18+
toolchains_path = os.path.join(os.getcwd(), 'toolchains.xml')
19+
20+
run_codeql_database_create([], lang="java", runFunction = runUnsuccessfully, db = None, extra_env={
21+
'LGTM_INDEX_MAVEN_TOOLCHAINS_FILE': toolchains_path
22+
})
1723

1824
check_diagnostics()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
3+
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
5+
</toolchains>

0 commit comments

Comments
 (0)