aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/bisect_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-08-21 20:11:28 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-08-22 12:20:14 +0000
commit81191e0ae93e179f148ee4f89deedfe444d7baaa (patch)
treeb30eaa0d463b0de9a62b5c19328d0dde6062756a /pkg/bisect/bisect_test.go
parent6b4158254bde639c89214e6f8f9db7f09e1d96c0 (diff)
pkg/bisect: start cause bisections from any commits
For cause bisections, don't require Kernel.Commit to be reachable from Kernel.Branch. We can start cause bisections from any existing commit. This should help with linux-next bisections, where no older HEADs are ever reachable from each new `master`.
Diffstat (limited to 'pkg/bisect/bisect_test.go')
-rw-r--r--pkg/bisect/bisect_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go
index c57ef7020..95849e419 100644
--- a/pkg/bisect/bisect_test.go
+++ b/pkg/bisect/bisect_test.go
@@ -173,7 +173,8 @@ func createTestRepo(t *testing.T) string {
}
}
}
- // Emulate another tree, that's needed for cross-tree tests.
+ // Emulate another tree, that's needed for cross-tree tests and
+ // for cause bisections for commits not reachable from master.
repo.Git("checkout", "v8.0")
repo.Git("checkout", "-b", "v8-branch")
repo.CommitFileChange("850", "v8-branch")
@@ -248,7 +249,7 @@ func testBisection(t *testing.T, baseDir string, test BisectionTest) {
res, err := runImpl(cfg, r, inst)
checkBisectionError(test, res, err)
- if !test.crossTree {
+ if !test.crossTree && !test.noFakeHashTest {
// Should be mitigated via GetCommitByTitle during bisection.
cfg.Kernel.Commit = fmt.Sprintf("fake-hash-for-%v-%v", cfg.Kernel.Commit, cfg.Kernel.CommitTitle)
res, err = runImpl(cfg, r, inst)
@@ -326,6 +327,7 @@ type BisectionTest struct {
baselineConfig string
resultingConfig string
crossTree bool
+ noFakeHashTest bool
extraTest func(t *testing.T, res *Result)
}
@@ -662,6 +664,15 @@ var bisectionTests = []BisectionTest{
crossTree: true,
fixCommit: "903",
},
+ {
+ name: "cause-finds-other-branch-commit",
+ startCommit: 852,
+ startCommitBranch: "v8-branch",
+ commitLen: 1,
+ expectRep: true,
+ introduced: "602",
+ noFakeHashTest: true,
+ },
}
func TestBisectionResults(t *testing.T) {