From 81191e0ae93e179f148ee4f89deedfe444d7baaa Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 21 Aug 2023 20:11:28 +0200 Subject: 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`. --- pkg/bisect/bisect_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'pkg/bisect/bisect_test.go') 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) { -- cgit mrf-deployment