diff --git a/java/ql/integration-tests/java/buildless-maven-existing-settings-xml/test.py b/java/ql/integration-tests/java/buildless-maven-existing-settings-xml/test.py index 811ef3bb926b..d34586fc6955 100644 --- a/java/ql/integration-tests/java/buildless-maven-existing-settings-xml/test.py +++ b/java/ql/integration-tests/java/buildless-maven-existing-settings-xml/test.py @@ -1,9 +1,12 @@ import os import os.path -def test(codeql, java, check_diagnostics_java): +def test(codeql, java, check_diagnostics_java, tmp_path): codeql.database.create(build_mode = "none", _env={ - "_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "home-dir-with-maven-settings") + "_JAVA_OPTIONS": " ".join([ + "-Duser.home=" + os.path.join(os.getcwd(), "home-dir-with-maven-settings"), + "-Dmaven.repo.local=" + str(tmp_path / "maven-repository") + ]) } ) diff --git a/java/ql/integration-tests/java/buildless-maven-mirrorof/test.py b/java/ql/integration-tests/java/buildless-maven-mirrorof/test.py index c24417c14405..e9a14a563240 100644 --- a/java/ql/integration-tests/java/buildless-maven-mirrorof/test.py +++ b/java/ql/integration-tests/java/buildless-maven-mirrorof/test.py @@ -1,10 +1,13 @@ import os import os.path -def test(codeql, java, check_diagnostics_java): +def test(codeql, java, check_diagnostics_java, tmp_path): codeql.database.create(build_mode = "none", _env={ - "_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "empty-home"), + "_JAVA_OPTIONS": " ".join([ + "-Duser.home=" + os.path.join(os.getcwd(), "empty-home"), + "-Dmaven.repo.local=" + str(tmp_path / "maven-repository") + ]), "LGTM_INDEX_MAVEN_SETTINGS_FILE": os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings.xml") } ) diff --git a/java/ql/integration-tests/java/buildless-maven/test.py b/java/ql/integration-tests/java/buildless-maven/test.py index 2e49378d9827..fdb6b208fc2a 100644 --- a/java/ql/integration-tests/java/buildless-maven/test.py +++ b/java/ql/integration-tests/java/buildless-maven/test.py @@ -1,9 +1,12 @@ import os import os.path -def test(codeql, java, check_diagnostics_java): +def test(codeql, java, check_diagnostics_java, tmp_path): codeql.database.create(build_mode = "none", _env={ - "_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "empty-home") + "_JAVA_OPTIONS": " ".join([ + "-Duser.home=" + os.path.join(os.getcwd(), "empty-home"), + "-Dmaven.repo.local=" + str(tmp_path / "maven-repository") + ]) } ) diff --git a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/test.py b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/test.py index 3aaee01f4055..a312878e107f 100644 --- a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/test.py +++ b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/test.py @@ -6,7 +6,9 @@ # The version of gradle used doesn't work on java 17 def test(codeql, use_java_11, java, environment, check_diagnostics): check_diagnostics.redact += ["attributes.java_vendor"] - check_diagnostics.replacements = [("11\\.[0-9]+\\.[0-9]+", "11")] + # the JDK build provided by the CI runner image may report any number of version components + # (e.g. `11.0.32` or `11.0.32.1`), so keep only the feature version + check_diagnostics.replacements = [(r'"11(\.[0-9]+)+"', '"11"')] gradle_override_dir = pathlib.Path(tempfile.mkdtemp()) if runs_on.windows: (gradle_override_dir / "gradle.bat").write_text("@echo off\nexit /b 2\n")