summaryrefslogtreecommitdiffhomepage
path: root/kokoro
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 /kokoro
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 'kokoro')
-rw-r--r--kokoro/build.cfg23
-rw-r--r--kokoro/common.cfg2
-rw-r--r--kokoro/continuous.cfg8
-rw-r--r--kokoro/do_tests.cfg9
-rw-r--r--kokoro/docker_tests.cfg9
-rw-r--r--kokoro/go.cfg6
-rw-r--r--kokoro/go_test.cfg1
-rw-r--r--kokoro/hostnet_tests.cfg9
-rw-r--r--kokoro/kvm_tests.cfg9
-rw-r--r--kokoro/make_tests.cfg9
-rw-r--r--kokoro/overlay_tests.cfg9
-rw-r--r--kokoro/presubmit.cfg6
-rw-r--r--kokoro/release-nightly.cfg5
-rw-r--r--kokoro/release.cfg1
-rw-r--r--kokoro/root_tests.cfg9
-rwxr-xr-x[l---------]kokoro/run_build.sh20
-rw-r--r--[l---------]kokoro/run_tests.sh30
-rw-r--r--kokoro/simple_tests.cfg9
-rw-r--r--kokoro/syscall_tests.cfg9
19 files changed, 168 insertions, 15 deletions
diff --git a/kokoro/build.cfg b/kokoro/build.cfg
new file mode 100644
index 000000000..d67af4694
--- /dev/null
+++ b/kokoro/build.cfg
@@ -0,0 +1,23 @@
+build_file: "repo/scripts/build.sh"
+
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73898
+ keyname: "kokoro-repo-key"
+ }
+ }
+}
+
+env_vars {
+ key: "KOKORO_REPO_KEY"
+ value: "$KOKORO_ROOT/src/keystore/73898_kokoro-repo-key"
+}
+
+action {
+ define_artifacts {
+ regex: "**/runsc"
+ regex: "**/runsc.sha256"
+ regex: "**/repo/**"
+ }
+}
diff --git a/kokoro/common.cfg b/kokoro/common.cfg
index cad873fe1..669a2e458 100644
--- a/kokoro/common.cfg
+++ b/kokoro/common.cfg
@@ -10,7 +10,7 @@ before_action {
# Configure bazel to access RBE.
bazel_setting {
- # Our GCP project name
+ # Our GCP project name.
project_id: "gvisor-rbe"
# Use RBE for execution as well as caching.
diff --git a/kokoro/continuous.cfg b/kokoro/continuous.cfg
index 8da47736a..88694220a 100644
--- a/kokoro/continuous.cfg
+++ b/kokoro/continuous.cfg
@@ -1,13 +1,11 @@
-# Location of bash script that runs the test. The first directory in the path
-# is the directory where Kokoro will check out the repo. The rest is the path
-# is the path to the test script.
-build_file: "repo/kokoro/run_tests.sh"
+# This is a temporary file. It will be removed when new Kokoro jobs exist for
+# all the other presubmits.
+build_file: "repo/scripts/build.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
- regex: "**/runsc-logs.tar.gz"
}
}
diff --git a/kokoro/do_tests.cfg b/kokoro/do_tests.cfg
new file mode 100644
index 000000000..b45ec0b42
--- /dev/null
+++ b/kokoro/do_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/do_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/docker_tests.cfg b/kokoro/docker_tests.cfg
new file mode 100644
index 000000000..717d71dd3
--- /dev/null
+++ b/kokoro/docker_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/docker_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/go.cfg b/kokoro/go.cfg
new file mode 100644
index 000000000..d1577252a
--- /dev/null
+++ b/kokoro/go.cfg
@@ -0,0 +1,6 @@
+build_file: "repo/scripts/go.sh"
+
+env_vars {
+ key: "KOKORO_GO_PUSH"
+ value: "true"
+}
diff --git a/kokoro/go_test.cfg b/kokoro/go_test.cfg
new file mode 100644
index 000000000..5eb51041a
--- /dev/null
+++ b/kokoro/go_test.cfg
@@ -0,0 +1 @@
+build_file: "repo/scripts/go.sh"
diff --git a/kokoro/hostnet_tests.cfg b/kokoro/hostnet_tests.cfg
new file mode 100644
index 000000000..532755f4a
--- /dev/null
+++ b/kokoro/hostnet_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/hostnet_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/kvm_tests.cfg b/kokoro/kvm_tests.cfg
new file mode 100644
index 000000000..54365c2b2
--- /dev/null
+++ b/kokoro/kvm_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/kvm_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/make_tests.cfg b/kokoro/make_tests.cfg
new file mode 100644
index 000000000..d973130ff
--- /dev/null
+++ b/kokoro/make_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/make_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/overlay_tests.cfg b/kokoro/overlay_tests.cfg
new file mode 100644
index 000000000..abd96f60c
--- /dev/null
+++ b/kokoro/overlay_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/overlay_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/presubmit.cfg b/kokoro/presubmit.cfg
index 8da47736a..eb0c78ea4 100644
--- a/kokoro/presubmit.cfg
+++ b/kokoro/presubmit.cfg
@@ -1,6 +1,5 @@
-# Location of bash script that runs the test. The first directory in the path
-# is the directory where Kokoro will check out the repo. The rest is the path
-# is the path to the test script.
+# This is a temporary file. It will be removed when new Kokoro jobs exist for
+# all the other presubmits.
build_file: "repo/kokoro/run_tests.sh"
action {
@@ -8,6 +7,5 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
- regex: "**/runsc-logs.tar.gz"
}
}
diff --git a/kokoro/release-nightly.cfg b/kokoro/release-nightly.cfg
index e5087b1cd..ae134258c 100644
--- a/kokoro/release-nightly.cfg
+++ b/kokoro/release-nightly.cfg
@@ -1,9 +1,8 @@
-# Location of bash script that builds a release.
+# This file is a temporary bridge. It will be removed shortly, when Kokoro jobs
+# are configured to point at the new build and release configurations.
build_file: "repo/kokoro/run_build.sh"
action {
- # Upload runsc binary and its checksum. It may be in multiple paths, so we
- # must use the wildcard.
define_artifacts {
regex: "**/runsc"
regex: "**/runsc.sha512"
diff --git a/kokoro/release.cfg b/kokoro/release.cfg
new file mode 100644
index 000000000..b9d35bc51
--- /dev/null
+++ b/kokoro/release.cfg
@@ -0,0 +1 @@
+build_file: "repo/scripts/release.sh"
diff --git a/kokoro/root_tests.cfg b/kokoro/root_tests.cfg
new file mode 100644
index 000000000..20b97766a
--- /dev/null
+++ b/kokoro/root_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/root_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/run_build.sh b/kokoro/run_build.sh
index 9deafe9bb..da6a0c85e 120000..100755
--- a/kokoro/run_build.sh
+++ b/kokoro/run_build.sh
@@ -1 +1,19 @@
-../tools/run_build.sh \ No newline at end of file
+#!/bin/bash
+
+# Copyright 2018 The gVisor Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is a temporary bridge. We will create multiple independent Kokoro
+# workflows that call each of the build scripts independently.
+KOKORO_BUILD_NIGHTLY=true $(dirname $0)/../scripts/build.sh
diff --git a/kokoro/run_tests.sh b/kokoro/run_tests.sh
index 931cd2622..5552da11c 120000..100644
--- a/kokoro/run_tests.sh
+++ b/kokoro/run_tests.sh
@@ -1 +1,29 @@
-../tools/run_tests.sh \ No newline at end of file
+#!/bin/bash
+
+# Copyright 2019 The gVisor Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -xeo pipefail
+
+# This file is a temporary bridge. We will create multiple independent Kokoro
+# workflows that call each of the test scripts independently.
+
+# Run all the tests in sequence.
+$(dirname $0)/../scripts/do_tests.sh
+$(dirname $0)/../scripts/make_tests.sh
+$(dirname $0)/../scripts/root_tests.sh
+$(dirname $0)/../scripts/docker_tests.sh
+$(dirname $0)/../scripts/overlay_tests.sh
+$(dirname $0)/../scripts/hostnet_tests.sh
+$(dirname $0)/../scripts/simple_tests.sh
diff --git a/kokoro/simple_tests.cfg b/kokoro/simple_tests.cfg
new file mode 100644
index 000000000..32e0a9431
--- /dev/null
+++ b/kokoro/simple_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/simple_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}
diff --git a/kokoro/syscall_tests.cfg b/kokoro/syscall_tests.cfg
new file mode 100644
index 000000000..ee6e4a3a4
--- /dev/null
+++ b/kokoro/syscall_tests.cfg
@@ -0,0 +1,9 @@
+build_file: "repo/scripts/syscall_tests.sh"
+
+action {
+ define_artifacts {
+ regex: "**/sponge_log.xml"
+ regex: "**/sponge_log.log"
+ regex: "**/outputs.zip"
+ }
+}