Kotlin: tweak plugin test

Put less emphasis on plugin build isolation, to get a better DevEx out
of it. The crux of the test is the database extraction part, not the
plugin build.
This commit is contained in:
Paolo Tranquilli
2025-07-14 13:50:48 +02:00
parent b43a0e758b
commit 77cab9d068
2 changed files with 7 additions and 10 deletions

View File

@@ -17,7 +17,10 @@ kt_jvm_library(
srcs = ["Plugin.kt"],
kotlinc_opts = ":kotlinc-options",
module_name = "test",
resource_strip_prefix = "%s/resources" % package_name(),
resource_strip_prefix = "../%s/%s/resources" % (
repo_name(),
package_name(),
),
resources = glob(["resources/**"]),
deps = [
"@kotlin-compiler-%s" % _version,

View File

@@ -10,20 +10,14 @@ def test(codeql, java_full, cwd, semmle_code_dir, test_dir):
commands.run(
[
f"{semmle_code_dir}/tools/bazel",
f"--output_user_root={build_dir}",
"--max_idle_secs=1",
"build",
"//java/ql/integration-tests/kotlin/linux/custom_plugin/plugin",
"--spawn_strategy=local",
"--nouse_action_cache",
"--noremote_accept_cached",
"--noremote_upload_local_results",
f'--symlink_prefix={cwd / "bazel-"}',
"@codeql//java/ql/integration-tests/kotlin/linux/custom_plugin/plugin",
],
_cwd=test_dir,
_cwd=semmle_code_dir,
)
shutil.copy(
"bazel-bin/java/ql/integration-tests/kotlin/linux/custom_plugin/plugin/plugin.jar",
f"{semmle_code_dir}/bazel-bin/external/ql+/java/ql/integration-tests/kotlin/linux/custom_plugin/plugin/plugin.jar",
"plugin.jar",
)
codeql.database.create(