summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-22 08:14:57 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-22 08:34:55 +0000
commit148a356dde11df9e306e7e7e13204c59211a6074 (patch)
treef67de01814773f5eefbe73b37b60c9508fc904a5
parente0b5b8901c07ac7883f0487c54b03e80b640e3d6 (diff)
downloadjenkins-scripts-maxim.tar.gz
tcwg_kernel-bisect.sh: Better handle regressions in merges commitsmaxim
At the moment we check only first parent of first_bad to confirm that it is good. This patch extends that to checking/finding a good parent of merge commits. Change-Id: I0cb38223e70b10531555615ca39f9d584948c751
-rwxr-xr-xtcwg_kernel-bisect.sh35
1 files changed, 29 insertions, 6 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index 61876313..24a0917b 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -198,8 +198,15 @@ if [ x"$res" = x"0" ]; then
first_bad=$(cat .git/BISECT_RUN | head -n 1 | grep "is the first bad commit" | cut -d" " -f 1)
assert [ x"$first_bad" != x"" ]
- last_good=$(git rev-parse $first_bad^)
- if ! grep -q $last_good "$artifacts/good_revs"; then
+ for last_good in $(git rev-parse $first_bad^@); do
+ if grep -q $last_good "$artifacts/good_revs"; then
+ # One of immediate parrents of $first_bad tested good.
+ break
+ fi
+ last_good=""
+ done
+ if [ x"$last_good" = x"" ]; then
+ # None of immediate parents of $first_bad tested as good.
# It seems that git-bisect assumes parent commit as "good" on
# the basis of one of its children being "good". Therefore we
# can have a situation when we have parent P with children C1 and C2,
@@ -208,10 +215,26 @@ if [ x"$res" = x"0" ]; then
# and it knows CB is "bad", so git-bisect returns C1 as the first bad
# commit.
# To simplify investigations we explicitly test parent of $first_bad.
- echo "Testing last_good $last_good (hoping for success)"
- git checkout --detach "$last_good"
- $artifacts/test.sh &
- res=0 && wait $! || res=$?
+ res=0
+ for last_good in $(git rev-parse $first_bad^@); do
+ if grep -q $last_good "$artifacts/bad_revs" "$artifacts/skipped_revs"; then
+ echo "First_bad's parent $last_good has tested bad or skipped"
+ last_good=""
+ continue
+ fi
+ if [ x"$(git merge-base $merge_base $last_good)" != x"$merge_base" ]; then
+ echo "First_bad's parent $last_good is outside of bisect scope"
+ last_good=""
+ continue
+ fi
+ echo "Testing first_bad's parent $last_good (hoping for success)"
+ git checkout --detach "$last_good"
+ $artifacts/test.sh &
+ res=0 && wait $! || res=$?
+ if [ x"$res" = x"0" ]; then
+ break
+ fi
+ done
if [ x"$res" != x"0" ]; then
# It seems $last_good was on a path that tested good, even though
# it itself is bad. We re-trigger the bisection job with updated