From b591f603a01ea5a51692f3da47e116f006a36b44 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Thu, 11 Feb 2021 16:44:32 -0500 Subject: [PATCH] [prototype] *: branch to run buildkite on Don't look. Release note: None --- build/bazelbuilder/bazelbuild.sh | 5 ++--- build/buildkite-ci.sh | 8 ++++++++ build/buildkite.sh | 15 +++++++++++++++ pkg/base/BUILD.bazel | 1 + pkg/cmd/cockroach-oss/BUILD.bazel | 1 + pkg/internal/codeowners/BUILD.bazel | 1 + pkg/internal/team/BUILD.bazel | 1 + 7 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 build/buildkite-ci.sh create mode 100755 build/buildkite.sh diff --git a/build/bazelbuilder/bazelbuild.sh b/build/bazelbuilder/bazelbuild.sh index a6d06278a451..251d3c315d30 100755 --- a/build/bazelbuilder/bazelbuild.sh +++ b/build/bazelbuilder/bazelbuild.sh @@ -2,6 +2,5 @@ set -xeuo pipefail -bazel build //pkg/cmd/cockroach-short -# Stage artifacts. -cp $(bazel info bazel-bin)/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short /artifacts +bazel build //pkg/cmd/cockroach-short --remote_cache='http://localhost:9090' +bazel test //pkg:small_tests --remote_cache='http://localhost:9090' diff --git a/build/buildkite-ci.sh b/build/buildkite-ci.sh new file mode 100755 index 000000000000..abf1390919a3 --- /dev/null +++ b/build/buildkite-ci.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -xeuo pipefail + +bazel build //pkg/cmd/cockroach-short --remote_cache='http://localhost:9090' +bazel test //pkg:small_tests --remote_cache='http://localhost:9090' +bazel test //pkg:medium_tests --remote_cache='http://localhost:9090' +bazel test //pkg:large_tests --remote_cache='http://localhost:9090' diff --git a/build/buildkite.sh b/build/buildkite.sh new file mode 100755 index 000000000000..8625a50e2b17 --- /dev/null +++ b/build/buildkite.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# root is the absolute path to the root directory of the repository. +root=$(cd "$(dirname "$0")/.." && pwd) + +# Bazel configuration for CI. +cp $root/.bazelrc.ci $root/.bazelrc.user + +docker run -i ${tty-} --rm --init \ + --workdir="/go/src/github.com/cockroachdb/cockroach" \ + --network=host \ + --volume "$root:/go/src/github.com/cockroachdb/cockroach" \ + cockroachdb/bazel:20210201-174432 /bin/bash < $root/build/buildkite-ci.sh diff --git a/pkg/base/BUILD.bazel b/pkg/base/BUILD.bazel index f0f069cc8a52..39290be1a461 100644 --- a/pkg/base/BUILD.bazel +++ b/pkg/base/BUILD.bazel @@ -46,6 +46,7 @@ go_library( go_test( name = "base_test", size = "small", + tags = ["broken_in_bazel"], srcs = [ "addr_validation_test.go", "cluster_id_test.go", diff --git a/pkg/cmd/cockroach-oss/BUILD.bazel b/pkg/cmd/cockroach-oss/BUILD.bazel index 90aeea1e8e5f..2621740caaa8 100644 --- a/pkg/cmd/cockroach-oss/BUILD.bazel +++ b/pkg/cmd/cockroach-oss/BUILD.bazel @@ -20,6 +20,7 @@ go_binary( go_test( name = "cockroach-oss_test", size = "medium", + tags = ["broken_in_bazel"], srcs = ["dep_test.go"], embed = [":cockroach-oss_lib"], deps = [ diff --git a/pkg/internal/codeowners/BUILD.bazel b/pkg/internal/codeowners/BUILD.bazel index 8b2eb1fab78f..1c1e78a7b396 100644 --- a/pkg/internal/codeowners/BUILD.bazel +++ b/pkg/internal/codeowners/BUILD.bazel @@ -18,6 +18,7 @@ go_test( size = "small", srcs = ["codeowners_test.go"], embed = [":codeowners"], + tags = ["broken_in_bazel"], deps = [ "//pkg/internal/team", "@com_github_stretchr_testify//require", diff --git a/pkg/internal/team/BUILD.bazel b/pkg/internal/team/BUILD.bazel index ea48549d6ecd..fd4c98a7bd06 100644 --- a/pkg/internal/team/BUILD.bazel +++ b/pkg/internal/team/BUILD.bazel @@ -16,5 +16,6 @@ go_test( size = "small", srcs = ["team_test.go"], embed = [":team"], + tags = ["broken_in_bazel"], deps = ["@com_github_stretchr_testify//require"], )