diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-09-18 17:03:06 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-09-18 17:04:53 -0700 |
commit | 28f431335b182519f420e026edac8b7bcfd2a40a (patch) | |
tree | 271bb2c3d22ec621418f3b8328a4bc15b51f0876 /test/runtimes/build_defs.bzl | |
parent | a1f84469218d148b1f8210370cb08677b0d74f49 (diff) |
Shard the runtime tests.
Default of 20 shards was arbitrary and will need fine-tuning in later CLs.
PiperOrigin-RevId: 269922871
Diffstat (limited to 'test/runtimes/build_defs.bzl')
-rw-r--r-- | test/runtimes/build_defs.bzl | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/test/runtimes/build_defs.bzl b/test/runtimes/build_defs.bzl index ac28cc037..19aceb6fb 100644 --- a/test/runtimes/build_defs.bzl +++ b/test/runtimes/build_defs.bzl @@ -1,19 +1,35 @@ """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) +def runtime_test( + lang, + image, + shard_count = 20, + size = "enormous"): + sh_test( + name = lang + "_test", + srcs = ["runner.sh"], + args = [ + "--lang", + lang, + "--image", + image, + ], + data = [ + ":runner", + ], + size = size, + shard_count = shard_count, + tags = [ + # Requires docker and runsc to be configured before the test runs. + "manual", + "local", + ], + ) + +def sh_test(**kwargs): + """Wraps the standard sh_test.""" + native.sh_test( + **kwargs + ) |