aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar dmarting <dmarting@google.com>2017-06-27 14:57:21 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-27 15:07:04 +0200
commit0010cc9fc25863a94f45e8872fcdfa67f685cd4b (patch)
tree721a14d1e989a413cee865bce4517f9237ce1717
parent6648268ad92f37bfb243c708cbd0937e2aa6eada (diff)
Move the docker tests in src/test/docker
This is a better location and tools/cpp is packaged in embedded_tools that make the test ends-up in embedded_tools, which is requiring network access to build embedded_tools! Side-effect: have to correctly mock the bazel workspace file on a couple of tests. This is blocking on https://bazel-review.googlesource.com/c/12350/ PiperOrigin-RevId: 160265524
-rw-r--r--BUILD2
-rw-r--r--WORKSPACE4
-rw-r--r--src/BUILD1
-rw-r--r--src/test/docker/BUILD (renamed from tools/cpp/test/BUILD)3
-rw-r--r--src/test/docker/Dockerfile.centos6.7 (renamed from tools/cpp/test/Dockerfile.centos6.7)0
-rw-r--r--src/test/docker/Dockerfile.debian-stretch (renamed from tools/cpp/test/Dockerfile.debian-stretch)0
-rw-r--r--src/test/docker/Dockerfile.fedora23 (renamed from tools/cpp/test/Dockerfile.fedora23)0
-rw-r--r--src/test/docker/Dockerfile.ubuntu-15.04 (renamed from tools/cpp/test/Dockerfile.ubuntu-15.04)0
-rw-r--r--src/test/docker/Dockerfile.ubuntu-16.04 (renamed from tools/cpp/test/Dockerfile.ubuntu-16.04)0
-rw-r--r--src/test/docker/docker_repository.bzl (renamed from tools/cpp/test/docker_repository.bzl)0
-rw-r--r--src/test/docker/docker_test.py (renamed from tools/cpp/test/docker_test.py)0
-rwxr-xr-xsrc/test/shell/bazel/apple/bazel_apple_test.sh3
-rwxr-xr-xsrc/test/shell/bazel/bound_targets_test.sh3
-rwxr-xr-xsrc/test/shell/testenv.sh12
-rw-r--r--tools/cpp/BUILD2
15 files changed, 21 insertions, 9 deletions
diff --git a/BUILD b/BUILD
index 5b7f88b7bf..14e114c054 100644
--- a/BUILD
+++ b/BUILD
@@ -40,7 +40,7 @@ filegroup(
srcs = [":WORKSPACE"],
visibility = [
"//src/test/shell/bazel:__subpackages__",
- "//tools/cpp/test:__pkg__",
+ "//src/test/docker:__pkg__",
],
)
diff --git a/WORKSPACE b/WORKSPACE
index c083719d03..dd6ef4edf6 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -33,8 +33,8 @@ bind(
actual = "//third_party/py/six",
)
-# For tools/cpp/test/...
-load("//tools/cpp/test:docker_repository.bzl", "docker_repository")
+# For src/test/docker/...
+load("//src/test/docker:docker_repository.bzl", "docker_repository")
docker_repository()
diff --git a/src/BUILD b/src/BUILD
index 4160591ba4..589964f0c3 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -360,6 +360,7 @@ filegroup(
"//src/objc_tools/bundlemerge:srcs",
"//src/objc_tools/plmerge:srcs",
"//src/test/cpp:srcs",
+ "//src/test/docker:srcs",
"//src/test/gen:srcs",
"//src/test/native:srcs",
"//src/test/java/com/google/devtools/build/android:srcs",
diff --git a/tools/cpp/test/BUILD b/src/test/docker/BUILD
index 68b18ad982..7393126af3 100644
--- a/tools/cpp/test/BUILD
+++ b/src/test/docker/BUILD
@@ -81,6 +81,7 @@ pkg_tar(
local = 1,
main = "docker_test.py",
tags = [
+ "docker",
"exclusive",
"local",
],
@@ -97,5 +98,5 @@ pkg_tar(
filegroup(
name = "srcs",
srcs = glob(["**"]),
- visibility = ["//tools/cpp:__pkg__"],
+ visibility = ["//src:__pkg__"],
)
diff --git a/tools/cpp/test/Dockerfile.centos6.7 b/src/test/docker/Dockerfile.centos6.7
index 9cab385cf0..9cab385cf0 100644
--- a/tools/cpp/test/Dockerfile.centos6.7
+++ b/src/test/docker/Dockerfile.centos6.7
diff --git a/tools/cpp/test/Dockerfile.debian-stretch b/src/test/docker/Dockerfile.debian-stretch
index a52716cde5..a52716cde5 100644
--- a/tools/cpp/test/Dockerfile.debian-stretch
+++ b/src/test/docker/Dockerfile.debian-stretch
diff --git a/tools/cpp/test/Dockerfile.fedora23 b/src/test/docker/Dockerfile.fedora23
index 396e1c66f2..396e1c66f2 100644
--- a/tools/cpp/test/Dockerfile.fedora23
+++ b/src/test/docker/Dockerfile.fedora23
diff --git a/tools/cpp/test/Dockerfile.ubuntu-15.04 b/src/test/docker/Dockerfile.ubuntu-15.04
index 57aab547d6..57aab547d6 100644
--- a/tools/cpp/test/Dockerfile.ubuntu-15.04
+++ b/src/test/docker/Dockerfile.ubuntu-15.04
diff --git a/tools/cpp/test/Dockerfile.ubuntu-16.04 b/src/test/docker/Dockerfile.ubuntu-16.04
index d70c7bbf35..d70c7bbf35 100644
--- a/tools/cpp/test/Dockerfile.ubuntu-16.04
+++ b/src/test/docker/Dockerfile.ubuntu-16.04
diff --git a/tools/cpp/test/docker_repository.bzl b/src/test/docker/docker_repository.bzl
index 4f96170176..4f96170176 100644
--- a/tools/cpp/test/docker_repository.bzl
+++ b/src/test/docker/docker_repository.bzl
diff --git a/tools/cpp/test/docker_test.py b/src/test/docker/docker_test.py
index a185e27775..a185e27775 100644
--- a/tools/cpp/test/docker_test.py
+++ b/src/test/docker/docker_test.py
diff --git a/src/test/shell/bazel/apple/bazel_apple_test.sh b/src/test/shell/bazel/apple/bazel_apple_test.sh
index 5fbd18933a..51a971807f 100755
--- a/src/test/shell/bazel/apple/bazel_apple_test.sh
+++ b/src/test/shell/bazel/apple/bazel_apple_test.sh
@@ -40,8 +40,7 @@ function set_up() {
XCODE_VERSION=$(cat xcode_versions | grep -m1 '7\|8')
# Allow access to //external:xcrunwrapper.
- rm WORKSPACE
- ln -sv ${workspace_file} WORKSPACE
+ use_bazel_workspace_file
}
function make_app() {
diff --git a/src/test/shell/bazel/bound_targets_test.sh b/src/test/shell/bazel/bound_targets_test.sh
index d7da26a029..f6d029b962 100755
--- a/src/test/shell/bazel/bound_targets_test.sh
+++ b/src/test/shell/bazel/bound_targets_test.sh
@@ -25,8 +25,7 @@ if [ "${PLATFORM}" != "darwin" ]; then
fi
function test_build_xcrunwrapper() {
- rm WORKSPACE
- ln -sv ${workspace_file} WORKSPACE
+ use_bazel_workspace_file
bazel build //external:xcrunwrapper || fail "should build xcrunwrapper"
}
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index f4f79922ce..019d13eaa8 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -160,6 +160,18 @@ else
hamcrest_jar=$(rlocation io_bazel/third_party/hamcrest/hamcrest-.*.jar)
fi
+
+function use_bazel_workspace_file() {
+ mkdir -p src/test/docker
+ cat >src/test/docker/docker_repository.bzl <<EOF
+def docker_repository():
+ pass
+EOF
+ touch src/test/docker/BUILD
+ rm -f WORKSPACE
+ ln -sf ${workspace_file} WORKSPACE
+}
+
# This function copies the tools directory from Bazel.
function copy_tools_directory() {
cp -RL ${tools_dir}/* tools
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index 6dd2a6052f..eef0c22db2 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -186,7 +186,7 @@ filegroup(
filegroup(
name = "srcs",
- srcs = glob(["**"]) + ["//tools/cpp/test:srcs"],
+ srcs = glob(["**"]),
)
filegroup(