Skip to content

Commit 5be101c

Browse files
scripts: improve trigger-pr-roachtest.sh (#171008)
scripts: improve trigger-pr-roachtest.sh
2 parents 2cd752f + 474b41b commit 5be101c

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

scripts/trigger-pr-roachtest.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,32 @@ if [ -z $token ]; then
1313
TEAMCITY_TOKEN not set. Get one here:
1414
1515
https://teamcity.cockroachdb.com/profile.html?item=accessTokens
16+
17+
Usage: $0 <pr-number-or-branch> <test-regex> [sha]
18+
19+
Examples:
20+
$0 12345 'perturbation/full/intents'
21+
$0 my-branch-name 'kv/splits.*' a1b2c3d4
22+
23+
Note: PR numbers work for all cases (recommended). Branch names only work
24+
for branches pushed directly to cockroachdb/cockroach, not personal forks.
25+
For fork branches, use the PR number instead.
26+
27+
Environment variables:
28+
COUNT - number of test iterations (default: 1)
29+
DEBUG - enable debug mode (default: false)
30+
USE_SPOT - use spot VMs: never, auto, always (default: never)
31+
The "auto" default in nightly scripts uses spot for the
32+
first attempt, which causes preemptions on single-iteration
33+
PR-triggered runs. Override here defaults to "never".
1634
EOF
1735
exit 1
1836
fi
1937

2038
pr=${1-}
2139

2240
while [ -z $pr ]; do
23-
read -p 'PR number (defaults to first arg, can also use branch name): ' pr
41+
read -p 'PR number or branch name (PR number recommended): ' pr
2442
done
2543

2644
tests=${2-}
@@ -50,6 +68,7 @@ json_payload=$(jq -n \
5068
--arg tests "$tests" \
5169
--arg envDebug "${DEBUG-false}" \
5270
--arg envCount "${COUNT-1}" \
71+
--arg envUseSpot "${USE_SPOT-never}" \
5372
'{
5473
buildType: {id: "Cockroach_Nightlies_RoachtestNightlyGceBazel"},
5574
branchName: $branch_name,
@@ -60,7 +79,8 @@ json_payload=$(jq -n \
6079
{name: "env.SELECT_PROBABILITY", value: "1.0"},
6180
{name: "env.DEBUG", value: $envDebug},
6281
{name: "env.COUNT", value: $envCount},
63-
{name: "env.TESTS", value: $tests}
82+
{name: "env.TESTS", value: $tests},
83+
{name: "env.USE_SPOT", value: $envUseSpot}
6484
]
6585
}
6686
}')

0 commit comments

Comments
 (0)