summaryrefslogtreecommitdiff
path: root/round-robin-bisect.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-05-13 14:27:20 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-05-14 14:33:09 +0000
commitb3334e58e24ea4ade3088c620dec315e62042754 (patch)
treec63901b67c695c61245ce88f8c407567ed3aba70 /round-robin-bisect.sh
parentf362d7f03b41898cb77901b01afab5efbf59016c (diff)
tcwg_bmk/round-robin: Add assert_with_msg function
This acts like assert but prints a message if the assert fails. This will be visible in the Jenkins logs and give us a unique string to look for in the abscence of traceback for shell scripts. Two instances of returning false in check_regression have had echos added to them, instead of asserts. This is because they are not hard failures, and may be handled by the caller. (run_step) I have only converted the tcwg-bmk relevant scripts to assert_with_msg so far, as a proof of concept. Change-Id: I3b1badf09e4856c80b973ca8b23088626ed66b0a
Diffstat (limited to 'round-robin-bisect.sh')
-rwxr-xr-xround-robin-bisect.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 46bed870..dde6e8db 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -196,7 +196,8 @@ if [ x"$res" = x"0" ]; then
if $rebase_workaround; then
echo "Rebase workaround: no regression between $baseline_rev and $bad_rev"
sed -i -e "s/\$/-bad_rev-good/" $artifacts/jenkins/build-name
- case "${rr[ci_project]}/${rr[ci_config]}:$current_project" in
+ project_name="${rr[ci_project]}/${rr[ci_config]}:$current_project"
+ case $project_name in
tcwg_kernel/llvm-*-next-*:linux)
cat > $artifacts/trigger-build-rebase <<EOF
llvm_branch=baseline
@@ -208,7 +209,7 @@ binutils_branch=baseline
gcc_branch=baseline
EOF
;;
- *) assert false ;;
+ *) assert_with_msg "Unknown project name: $project_name" false ;;
esac
cat >> $artifacts/trigger-build-rebase <<EOF
linux_branch=$baseline_rev
@@ -392,7 +393,7 @@ if [ x"$(get_first_bad)" = x"" ]; then
res=0 && wait $! || res=$?
if [ x"$res" = x"0" ]; then
- assert [ x"$(get_first_bad)" != x"" ]
+ assert_with_msg "Didn't find first bad commit!" [ x"$(get_first_bad)" != x"" ]
fi
fi
@@ -428,9 +429,9 @@ if [ x"$first_bad" != x"" ]; then
# It seems $last_good was on a path that tested good, even though
# it itself is bad.
#
- # We need to be careful to avoid re-trigger loops, so verify that
- # last_good is an ancestor of bad_rev.
- assert git merge-base --is-ancestor $last_good $bad_rev
+ # We need to be careful to avoid re-trigger loops
+ assert_with_msg "Last good is not an ancestor of bad rev!" \
+ git merge-base --is-ancestor $last_good $bad_rev
if git merge-base --is-ancestor $baseline_rev $last_good; then
# $last_good is a child of $baseline_rev, so we can re-trigger
# bisection with reduced bisection range.