Skip to content

Commit

Permalink
Merge pull request cockroachdb#81423 from cockroachdb/blathers/backpo…
Browse files Browse the repository at this point in the history
…rt-release-22.1-80855

release-22.1: build: race-test only `pkg/server` on master/bors
  • Loading branch information
tbg authored Jun 9, 2022
2 parents 6bd74ff + 49551b0 commit 741c574
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions build/teamcity-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ tc_release_branch() {
[[ "$TC_BUILD_BRANCH" == master || "$TC_BUILD_BRANCH" == release-* || "$TC_BUILD_BRANCH" == provisional_* ]]
}

tc_bors_branch() {
[[ "$TC_BUILD_BRANCH" == staging ]]
}

if_tc() {
if [[ "${TC_BUILD_ID-}" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions build/teamcity-testrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export TMPDIR=$PWD/artifacts/testrace
mkdir -p "$TMPDIR"

tc_start_block "Determine changed packages"
if tc_release_branch; then
pkgspec=./pkg/...
echo "On release branch ($TC_BUILD_BRANCH), so running testrace on all packages ($pkgspec)"
if tc_release_branch || tc_bors_branch; then
pkgspec=./pkg/server
echo "On release or bors branch ($TC_BUILD_BRANCH), so running testrace canary only ($pkgspec)"
else
pkgspec=$(changed_go_pkgs)
if [[ $(echo "$pkgspec" | wc -w) -gt 10 ]]; then
Expand Down
13 changes: 11 additions & 2 deletions build/teamcity/cockroach/ci/tests/testrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))"
source "$dir/teamcity-support.sh" # For $root, changed_go_pkgs
source "$dir/teamcity-bazel-support.sh" # For run_bazel

# The full race suite takes >4h and is only suitable for nightlies. On master
# and staging, run just the `server` package which (at the time of writing)
# takes <30m to run and exercises most of the code in the system at least
# rudimentarily. This (hopefully) causes obvious races to fail in bors,
# before spraying failures over the nightly stress suite.
canaryspec=./pkg/server
tc_start_block "Determine changed packages"
if tc_release_branch; then
pkgspec=./pkg/...
echo "On release branch ($TC_BUILD_BRANCH), so running testrace on all packages ($pkgspec)"
pkgspec="${canaryspec}"
echo "On release branch ($TC_BUILD_BRANCH), so running canary testrace ($pkgspec)"
elif tc_bors_branch; then
pkgspec="${canaryspec}"
echo "On bors branch ($TC_BUILD_BRANCH), so running canary testrace ($pkgspec)"
else
pkgspec=$(changed_go_pkgs)
if [[ $(echo "$pkgspec" | wc -w) -gt 10 ]]; then
Expand Down

0 comments on commit 741c574

Please sign in to comment.