Skip to content

Commit b5bc959

Browse files
committed
build: add new Nightly Stress Extra pipeline script
We would like to be able to run a hand-curated list of tests for many more iterations than the current nightly suite. Epic: none Release note: None
1 parent ac3b2b7 commit b5bc959

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Cockroach Authors.
4+
#
5+
# Use of this software is governed by the CockroachDB Software License
6+
# included in the /LICENSE file.
7+
8+
set -euxo pipefail
9+
10+
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
11+
12+
source "$dir/teamcity-support.sh"
13+
source "$dir/teamcity-bazel-support.sh"
14+
15+
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e BUILD_VCS_NUMBER -e GITHUB_API_TOKEN -e GITHUB_REPO -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL" \
16+
run_bazel build/teamcity/cockroach/nightlies/cockroach_nightly_extra_stress_impl.sh
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Cockroach Authors.
4+
#
5+
# Use of this software is governed by the CockroachDB Software License
6+
# included in the /LICENSE file.
7+
8+
set -euxo pipefail
9+
10+
# These are provided as variables to test the script locally.
11+
BAZEL_CONFIG="${BAZEL_CONFIG:-ci}"
12+
ARTIFACTS_DIR="${ARTIFACTS_DIR:-/artifacts}"
13+
14+
# TEST_PACKAGE_TARGETS is a space-separated list of package containing the
15+
# tests in test_to_run.
16+
export TEST_PACKAGE_TARGETS="//pkg/kv/kvnemesis:kvnemesis_test"
17+
18+
# tests_to_run is a hand-curated list of tests that we want to run more often
19+
# under stress.
20+
#
21+
# PLEASE KEEP THIS LIST SHORT.
22+
declare -a tests_to_run=(
23+
"TestKVNemesisMultiNode"
24+
"TestKVNemesisMultiNode_BufferedWritesLockDurabilityUpgrades"
25+
)
26+
27+
test_exists() {
28+
git grep -q "func ${1}("
29+
}
30+
31+
# This builds a filter string in the form of ^(TestName1|TestName2|...)$ to
32+
# ensure that we are only running the tests in the tests_to_run array.
33+
test_filter="^("
34+
sep=""
35+
for t in "${tests_to_run[@]}"; do
36+
# We look for this test somewhere in the repository so we can fail the test if
37+
# someone changes the name of a test without updating this file.
38+
if ! test_exists "$t"; then
39+
echo "could not find test ${t}"
40+
exit 1
41+
fi
42+
43+
test_filter="${test_filter}${sep}${t}"
44+
sep="|"
45+
done
46+
test_filter="${test_filter})\$"
47+
48+
export RUNS_PER_TEST=1000
49+
export TEST_ARGS="--test_timeout=25200 --runs_per_test $RUNS_PER_TEST"
50+
51+
mkdir -p $ARTIFACTS_DIR
52+
53+
bazel build //pkg/cmd/bazci
54+
55+
BAZEL_BIN=$(bazel info bazel-bin)
56+
57+
exit_status=0
58+
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci -- test $TEST_PACKAGE_TARGETS \
59+
--config=$BAZEL_CONFIG \
60+
--test_env TC_SERVER_URL \
61+
$TEST_ARGS \
62+
--test_filter="$test_filter" \
63+
|| exit_status=$?
64+
65+
exit $exit_status

0 commit comments

Comments
 (0)