Skip to content

Commit c484d09

Browse files
craig[bot]rail
andcommitted
Merge #157158
157158: roachtest: do not build arm64 and fips if probabilitiy is 0 r=DarrylWong a=rail Previously, even when the probabilities for arm64 and fips builds were set to 0, the nightly roachtest script would still build those variants, which is unnecessary. This change modifies the script to skip building arm64 and fips variants when their respective probabilities are set to 0. Epic: none Release note: none Co-authored-by: Rail Aliiev <[email protected]>
2 parents 0375f11 + 735188e commit c484d09

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,26 @@ if [[ ! -f ~/.ssh/id_rsa.pub ]]; then
1919
ssh-keygen -q -C "roachtest-nightly-bazel $(date)" -N "" -f ~/.ssh/id_rsa
2020
fi
2121

22+
arm_probability="${ARM_PROBABILITY:-0.5}"
23+
fips_probability="${FIPS_PROBABILITY:-0.02}"
24+
2225
arch=amd64
2326
if [[ ${CLOUD} == "ibm" ]]; then
2427
arch=s390x
2528
fi
2629
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh $arch
2730
if [[ $arch != "s390x" ]]; then
28-
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh arm64
31+
# Do not build arm64 if the probability is 0.
32+
# Use `bc` for float comparison, bash supports only integer comparison.
33+
if (( $(echo "$arm_probability > 0" | bc -l) )); then
34+
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh arm64
35+
fi
2936
# N.B. FIPS is metamoprhically always on as of PR#139510
30-
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh amd64-fips
37+
# Do not build fips if the probability is 0.
38+
# Use `bc` for float comparison, bash supports only integer comparison.
39+
if (( $(echo "$fips_probability > 0" | bc -l) )); then
40+
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh amd64-fips
41+
fi
3142
fi
3243

3344
artifacts=/artifacts
@@ -89,8 +100,8 @@ fi
89100
#
90101
build/teamcity-roachtest-invoke.sh \
91102
--metamorphic-encryption-probability=0.5 \
92-
--metamorphic-arm64-probability="${ARM_PROBABILITY:-0.5}" \
93-
--metamorphic-fips-probability="${FIPS_PROBABILITY:-0.02}" \
103+
--metamorphic-arm64-probability="$arm_probability" \
104+
--metamorphic-fips-probability="$fips_probability" \
94105
--metamorphic-cockroach-ea-probability="${COCKROACH_EA_PROBABILITY:-0.2}" \
95106
${select_probability:-} \
96107
--always-collect-artifacts="${ALWAYS_COLLECT_ARTIFACTS:-false}" \

0 commit comments

Comments
 (0)