summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/build_defs.bzl
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2018-12-14 11:24:47 -0800
committerShentubot <shentubot@google.com>2018-12-14 11:25:36 -0800
commitcd1e9a3fd42f2e91781cf61f010d1aa3f02f72c1 (patch)
tree1da13964dca16f19ed393ab8ffa748c0e3684897 /test/syscalls/build_defs.bzl
parent5301cbf8430e5436211bc142c0886d8c11cc71ab (diff)
Shard the syscall tests.
PiperOrigin-RevId: 225574278 Change-Id: If5060a37e8a9b0120bec2b5de4037354f0eaba16
Diffstat (limited to 'test/syscalls/build_defs.bzl')
-rw-r--r--test/syscalls/build_defs.bzl19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/syscalls/build_defs.bzl b/test/syscalls/build_defs.bzl
index 31b311f63..d7feeb9e1 100644
--- a/test/syscalls/build_defs.bzl
+++ b/test/syscalls/build_defs.bzl
@@ -2,12 +2,12 @@
# syscall_test is a macro that will create targets to run the given test target
# on the host (native) and runsc.
-def syscall_test(test, size = "small"):
- _syscall_test(test, size, "native")
- _syscall_test(test, size, "kvm")
- _syscall_test(test, size, "ptrace")
+def syscall_test(test, shard_count = 1, size = "small"):
+ _syscall_test(test, shard_count, size, "native")
+ _syscall_test(test, shard_count, size, "kvm")
+ _syscall_test(test, shard_count, size, "ptrace")
-def _syscall_test(test, size, platform):
+def _syscall_test(test, shard_count, size, platform):
test_name = test.split(":")[1]
# Prepend "runsc" to non-native platform names.
@@ -30,13 +30,13 @@ def _syscall_test(test, size, platform):
srcs = ["syscall_test_runner.sh"],
name = test_name + "_" + full_platform,
data = [
- ":syscall_test",
+ ":syscall_test_runner",
test,
],
args = [
- # First argument is location to syscall_test binary.
- "$(location :syscall_test)",
- # Rest of arguments are passed directly to syscall_test binary.
+ # First argument is location to syscall_test_runner go binary.
+ "$(location :syscall_test_runner)",
+ # Rest of arguments are passed directly to syscall_test_runner binary.
"--test-name=" + test_name,
"--platform=" + platform,
"--debug=false",
@@ -45,6 +45,7 @@ def _syscall_test(test, size, platform):
],
size = size,
tags = tags,
+ shard_count = shard_count,
)
def sh_test(**kwargs):