summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-01-06 09:54:37 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-01-13 16:54:43 +0000
commit8b78dcbbb58168994aa58ac649c430c1227d0f6d (patch)
tree9e2b072719ca228f48ab3ccd562bf2ba452cabab
parent499beadee30558c56a88c772195615074ff29ca7 (diff)
round-robin-bisect.sh: Generalize logic of handling "reset" commit
We overloaded meaning of "$first_bad" revision to be also the reset commit, and this change splits off meaning of "reset" commit from "first_bad" commit. Change-Id: I62d9adc5fcd0d7d03f8b4cc33a2699f993aa5e8a
-rwxr-xr-xround-robin-bisect.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 3e2aee39..152dde25 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -394,6 +394,7 @@ if [ x"$(get_first_bad)" = x"" ]; then
fi
first_bad=$(get_first_bad)
+reset_rev="$first_bad"
notify_devs=true
if [ x"$first_bad" != x"" ]; then
# "git bisect run" succeeded. Check whether this is an actual regression
@@ -479,13 +480,14 @@ else
[ x"$last_good" != x"" ]
if [ x"$last_good" != x"$baseline_rev" ]; then
+ # $reset_rev=="" due to $first_bad==""
cat > $artifacts/trigger-build-1-advance <<EOF
${current_project}_url=$bad_url
${current_project}_branch=$last_good
EOF
sed -i -e "s/\$/-advance-baseline/" $artifacts/jenkins/build-name
else
- first_bad=$(print_tested_revs bad | tail -n1)
+ reset_rev=$(print_tested_revs bad | tail -n1)
sed -i -e "s/\$/-reset-baseline/" $artifacts/jenkins/build-name
fi
# Don't send any emails.
@@ -507,20 +509,20 @@ if ! [ -f $artifacts/build-$bad_rev/trigger-build-$current_project ]; then
$artifacts/build-$bad_rev/trigger-build-$current_project
fi
-if ! [ -f $artifacts/build-$first_bad/trigger-build-$current_project ]; then
- # This is rare, but git bisect can infer that a commit is first-bad
- # without actually testing it. Workaround by constructing trigger-build
- # file from that of $bad_rev's.
- mkdir -p $artifacts/build-$first_bad
- cp $artifacts/build-$bad_rev/trigger-build-$current_project \
- $artifacts/build-$first_bad/trigger-build-$current_project
- sed -i -e "s/$first_bad/$bad_rev/" $artifacts/trigger-build-2-default
-fi
+if [ x"$reset_rev" != x"" ]; then \
+ if ! [ -f $artifacts/build-$reset_rev/trigger-build-$current_project ]; then
+ # This is rare, but can happen that $reset_rev hasn't been tested.
+ # Workaround by constructing trigger-build file from that of $bad_rev's.
+ mkdir -p $artifacts/build-$reset_rev
+ cp $artifacts/build-$bad_rev/trigger-build-$current_project \
+ $artifacts/build-$reset_rev/trigger-build-$current_project
+ sed -i -e "s/^${current_project}_branch=$bad_rev\$/${current_project}_branch=$reset_rev/" \
+ $artifacts/build-$reset_rev/trigger-build-$current_project
+ fi
-if ! [ -f $artifacts/trigger-build-1-advance ]; then
# Reset baseline to the regressed commit so that we will catch subsequent
# regressions (worse than $bad_rev).
- cp $artifacts/build-$first_bad/trigger-build-$current_project \
+ cp $artifacts/build-$reset_rev/trigger-build-$current_project \
$artifacts/trigger-build-1-reset
echo "update_baseline=reset" >> $artifacts/trigger-build-1-reset
fi