treewide: replace hardcoded runfiles paths
We hardcoded some of the runfiles paths to find specific files. This replaces the hardcoded paths by a call to rlocationpath. This prevents running a target without the correct dependencies at build time instead of at runtime
Change-Id: I7ce56935ac80be6b28b824ccb0781ab401bd6521
Reviewed-on: https://review.monogon.dev/c/monogon/+/3301
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/installer/test/BUILD.bazel b/metropolis/installer/test/BUILD.bazel
index 7f71218..3f74cde 100644
--- a/metropolis/installer/test/BUILD.bazel
+++ b/metropolis/installer/test/BUILD.bazel
@@ -1,24 +1,26 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("//metropolis/node/build:efi.bzl", "efi_unified_kernel_image")
go_test(
- name = "installer",
+ name = "test_test",
size = "medium",
+ srcs = ["run_test.go"],
data = [
":kernel",
"//metropolis/installer/test/testos:testos_bundle",
- "//third_party/edk2:firmware",
+ "//third_party/edk2:OVMF_CODE.fd",
+ "//third_party/edk2:OVMF_VARS.fd",
"@qemu//:qemu-x86_64-softmmu",
],
- embed = [":test"],
- rundir = ".",
-)
-
-go_library(
- name = "test",
- srcs = ["main.go"],
importpath = "source.monogon.dev/metropolis/installer/test",
visibility = ["//visibility:private"],
+ x_defs = {
+ "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
+ "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+ "xQemuPath": "$(rlocationpath @qemu//:qemu-x86_64-softmmu )",
+ "xInstallerPath": "$(rlocationpath :kernel )",
+ "xBundlePath": "$(rlocationpath //metropolis/installer/test/testos:testos_bundle )",
+ },
deps = [
"//metropolis/cli/metroctl/core",
"//metropolis/node/build/mkimage/osimage",