aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/docker/BUILD
blob: e489a6b019932f575ba703b88d1ca4a1c7b6284d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
load("//tools/build_defs/docker:docker.bzl", "docker_build")
load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("//src/test/docker:flavours.bzl", "FLAVOURS")

pkg_tar(
    name = "bazel_cc_configure",
    package_dir = "/opt/workspace",
    strip_prefix = "/",
    deps = ["//:bazel-distfile-tar"],
)

[
    [docker_build(
        name = "bazel_cc_configure-%s-%s" % (flavour, mode),
        base = "@docker-%s//:image" % flavour,
        entrypoint = "/opt/workspace/compile.sh && ./output/bazel test ${EXTRA_BAZEL_ARGS} //examples/cpp:hello-success_test",
        env = {
            "EXTRA_BAZEL_ARGS": "--spawn_strategy=standalone --genrule_strategy=standalone -c %s" % mode,
        },
        tars = [":bazel_cc_configure"],
        workdir = "/opt/workspace",
    ) for mode in [
        "dbg",
        "opt",
        "fastbuild",
    ]]
    for flavour in FLAVOURS
]

# TODO(#2418): reactivate debian-stretch opt (flaky)
[
    [py_test(
        name = "test_cc_configure-%s-%s" % (flavour, mode),
        size = "large",
        srcs = ["docker_test.py"],
        args = [
            "--main='$(location :bazel_cc_configure-%s-%s)'" % (flavour, mode),
            "--docker='../docker/docker'",
        ],
        data = [
            ":bazel_cc_configure-%s-%s" % (flavour, mode),
            "@docker//:docker",
        ],
        local = 1,
        main = "docker_test.py",
        tags = [
            "docker",
            "exclusive",
            "local",
        ],
        deps = ["//third_party/py/gflags"],
    ) for mode in [
        "dbg",
        "opt",
        "fastbuild",
    ]]
    for flavour in FLAVOURS
    if flavour != "debian-stretch"
]

filegroup(
    name = "srcs",
    srcs = glob(["**"]),
    visibility = ["//src:__pkg__"],
)