aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-12-10 10:59:01 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-12-10 12:35:10 +0100
commit4538d6d746f2dc7443cb25940513ef23dbb275f0 (patch)
tree7f6e3ccbe559cf8de8a4aa60fbb444006532158a /pkg/bisect
parente068fcf62261c6ecd6416418c7adcba000213072 (diff)
pkg/bisect: add test for #1527
Update #1527
Diffstat (limited to 'pkg/bisect')
-rw-r--r--pkg/bisect/bisect_test.go26
1 files changed, 24 insertions, 2 deletions
diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go
index 56e5e5ccb..701b35edc 100644
--- a/pkg/bisect/bisect_test.go
+++ b/pkg/bisect/bisect_test.go
@@ -74,7 +74,18 @@ func runBisection(t *testing.T, test BisectionTest) (*Result, error) {
}
for rv := 4; rv < 10; rv++ {
for i := 0; i < 6; i++ {
- repo.CommitChange(fmt.Sprintf("%v", rv*100+i))
+ if rv == 7 && i == 0 {
+ // Create a slightly special commit graph here (for #1527):
+ // Commit 650 is part of 700 release, but it does not have
+ // 600 (the previous release) in parents, instead it's based
+ // on the previous-previous release 500.
+ repo.Git("checkout", "v5.0")
+ com := repo.CommitChange("650")
+ repo.Git("checkout", "master")
+ repo.Git("merge", "-m", "700", com.Hash)
+ } else {
+ repo.CommitChange(fmt.Sprintf("%v", rv*100+i))
+ }
if i == 0 {
repo.SetTag(fmt.Sprintf("v%v.0", rv))
}
@@ -168,7 +179,7 @@ func TestBisectionResults(t *testing.T) {
startCommit: 802,
brokenStart: 500,
brokenEnd: 700,
- commitLen: 14,
+ commitLen: 15,
culprit: 605,
},
// Tests that bisection returns the correct fix commit.
@@ -296,6 +307,17 @@ func TestBisectionResults(t *testing.T) {
culprit: 900,
isRelease: true,
},
+ {
+ name: "cause-not-in-previous-release",
+ startCommit: 905,
+ culprit: 650,
+ commitLen: 1,
+ expectRep: true,
+ sameBinaryStart: 500,
+ sameBinaryEnd: 650,
+ // This should be (see #1527):
+ // noopChange: true,
+ },
}
for _, test := range tests {
test := test