summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-16 09:49:44 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-16 15:12:06 +0000
commit756686a512367ef4b93eeaa58deae109f00e8daa (patch)
tree510e014fcad313194669b4e21ee231ff39f5c0f8
parent267741394c0b7d904f0892f5a51c04d55833950d (diff)
tcwg_kernel-bisect.sh: Handle bisect corner-cases
When git-bisect tests commit C as good then it assumes that all predecessors of C are good, which may not be the case when several unrelated failures occur. This patch improves handling of case when parent of $first_bad commit is bad itself. Change-Id: I8f6f55b4f3683d0e4f34d1714eeb74a46f4d6f0c
-rwxr-xr-xtcwg_kernel-bisect.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index 5d7b093d..cc33ac33 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -276,6 +276,12 @@ if [ -f $artifacts/first-bad ]; then
fi
last_good=$(git -C $current_project rev-parse $first_bad^)
+
+ good_name="last_good"
+ good_sha1="$last_good"
+ bad_name="first_bad"
+ bad_sha1="$first_bad"
+
if ! grep -q $last_good "$artifacts/good_revs"; then
# It seems that git-bisect assumes parent commit as "good" on
# the basis of one of its children being "good". Therefore we
@@ -291,8 +297,12 @@ if [ -f $artifacts/first-bad ]; then
../bisect-run.sh &
res=0 && wait $! || res=$?
if [ x"$res" != x"0" ]; then
- echo "ERROR: build for last_good $last_good failed"
- exit 1
+ # It seems $last_good was on a path that tested good, even though
+ # it itself is bad. Not much we can do here -- fallback to $good_rev.
+ echo "WARNING: build for last_good $last_good failed"
+ last_good="$good_rev"
+ good_name="good_rev"
+ good_sha1="$good_rev"
fi
cd ..
fi
@@ -304,10 +314,6 @@ if [ -f $artifacts/first-bad ]; then
ln -s "build-$last_good-last_good" "$artifacts/build-$last_good-baseline"
fi
- good_name="last_good"
- good_sha1="$last_good"
- bad_name="first_bad"
- bad_sha1="$first_bad"
cat >> $artifacts/jenkins/mail-body.txt <<EOF
Successfully identified regression in $current_project on $target @ $toolchain-${rr[${toolchain}_version]} @ linux-${rr[linux_version]}-$linux_config between bad $bad_rev and baseline $baseline_rev .
@@ -318,8 +324,8 @@ $(git -C $current_project log -n 1 $first_bad)
EOF
else
- good_name="baseline"
- good_sha1="$baseline_rev"
+ good_name="good_rev"
+ good_sha1="$good_rev"
bad_name="bad"
bad_sha1="$bad_rev"
cat >> $artifacts/jenkins/mail-body.txt <<EOF