summaryrefslogtreecommitdiffhomepage
path: root/runsc/test/build_defs.bzl
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-06-18 01:40:12 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-18 01:41:29 -0700
commit3d1e44a677ecacbf81888211a93cef0a71c1c6c0 (patch)
tree39ba6e6996c2adff48c464e3de395f706b3a435d /runsc/test/build_defs.bzl
parent66cc0e9f928218ca642a41fa67bb163197aa1f37 (diff)
gvisor/kokoro: don't modify tests names in the BUILD file
PiperOrigin-RevId: 253746380
Diffstat (limited to 'runsc/test/build_defs.bzl')
-rw-r--r--runsc/test/build_defs.bzl19
1 files changed, 19 insertions, 0 deletions
diff --git a/runsc/test/build_defs.bzl b/runsc/test/build_defs.bzl
new file mode 100644
index 000000000..ac28cc037
--- /dev/null
+++ b/runsc/test/build_defs.bzl
@@ -0,0 +1,19 @@
+"""Defines a rule for runsc test targets."""
+
+load("@io_bazel_rules_go//go:def.bzl", _go_test = "go_test")
+
+# runtime_test is a macro that will create targets to run the given test target
+# with different runtime options.
+def runtime_test(**kwargs):
+ """Runs the given test target with different runtime options."""
+ name = kwargs["name"]
+ _go_test(**kwargs)
+ kwargs["name"] = name + "_hostnet"
+ kwargs["args"] = ["--runtime-type=hostnet"]
+ _go_test(**kwargs)
+ kwargs["name"] = name + "_kvm"
+ kwargs["args"] = ["--runtime-type=kvm"]
+ _go_test(**kwargs)
+ kwargs["name"] = name + "_overlay"
+ kwargs["args"] = ["--runtime-type=overlay"]
+ _go_test(**kwargs)