summaryrefslogtreecommitdiffhomepage
path: root/test/runtimes
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2019-09-03 22:01:34 -0700
committergVisor bot <gvisor-bot@google.com>2019-09-03 22:02:43 -0700
commit67a2ab1438cdccbe045143bbfaa807cf83110ebc (patch)
tree8c17f5ecd3e5b3e9c4decb46d8f2b2e893809dc1 /test/runtimes
parent144127e5e1c548150f49501a7decb82ec2e239f2 (diff)
Impose order on test scripts.
The simple test script has gotten out of control. Shard this script into different pieces and attempt to impose order on overall test structure. This change helps lay some of the foundations for future improvements. * The runsc/test directories are moved into just test/. * The runsc/test/testutil package is split into logical pieces. * The scripts/ directory contains new top-level targets. * Each test is now responsible for building targets it requires. * The install functionality is moved into `runsc` itself for simplicity. * The existing kokoro run_tests.sh file now just calls all (can be split). After this change is merged, I will create multiple distinct workflows for Kokoro, one for each of the scripts currently targeted by `run_tests.sh` today, which should dramatically reduce the time-to-run for the Kokoro tests, and provides a better foundation for further improvements to the infrastructure. PiperOrigin-RevId: 267081397
Diffstat (limited to 'test/runtimes')
-rw-r--r--test/runtimes/BUILD4
-rw-r--r--test/runtimes/build_defs.bzl19
-rw-r--r--test/runtimes/common/BUILD2
-rw-r--r--test/runtimes/common/common_test.go2
-rw-r--r--test/runtimes/runtimes_test.go2
5 files changed, 24 insertions, 5 deletions
diff --git a/test/runtimes/BUILD b/test/runtimes/BUILD
index e85804a83..5616a8b7b 100644
--- a/test/runtimes/BUILD
+++ b/test/runtimes/BUILD
@@ -1,7 +1,7 @@
# These packages are used to run language runtime tests inside gVisor sandboxes.
load("@io_bazel_rules_go//go:def.bzl", "go_library")
-load("//runsc/test:build_defs.bzl", "runtime_test")
+load("//test/runtimes:build_defs.bzl", "runtime_test")
package(licenses = ["notice"])
@@ -21,5 +21,5 @@ runtime_test(
"manual",
"local",
],
- deps = ["//runsc/test/testutil"],
+ deps = ["//runsc/testutil"],
)
diff --git a/test/runtimes/build_defs.bzl b/test/runtimes/build_defs.bzl
new file mode 100644
index 000000000..ac28cc037
--- /dev/null
+++ b/test/runtimes/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)
diff --git a/test/runtimes/common/BUILD b/test/runtimes/common/BUILD
index 1b39606b8..b4740bb97 100644
--- a/test/runtimes/common/BUILD
+++ b/test/runtimes/common/BUILD
@@ -15,6 +15,6 @@ go_test(
srcs = ["common_test.go"],
deps = [
":common",
- "//runsc/test/testutil",
+ "//runsc/testutil",
],
)
diff --git a/test/runtimes/common/common_test.go b/test/runtimes/common/common_test.go
index 4fb1e482a..65875b41b 100644
--- a/test/runtimes/common/common_test.go
+++ b/test/runtimes/common/common_test.go
@@ -23,7 +23,7 @@ import (
"strings"
"testing"
- "gvisor.dev/gvisor/runsc/test/testutil"
+ "gvisor.dev/gvisor/runsc/testutil"
"gvisor.dev/gvisor/test/runtimes/common"
)
diff --git a/test/runtimes/runtimes_test.go b/test/runtimes/runtimes_test.go
index 9421021a1..0ff5dda02 100644
--- a/test/runtimes/runtimes_test.go
+++ b/test/runtimes/runtimes_test.go
@@ -19,7 +19,7 @@ import (
"testing"
"time"
- "gvisor.dev/gvisor/runsc/test/testutil"
+ "gvisor.dev/gvisor/runsc/testutil"
)
// Wait time for each test to run.