diff --git a/pkg/integration/tests/bisect/mark_candidates_while_testing_merge_base.go b/pkg/integration/tests/bisect/mark_candidates_while_testing_merge_base.go new file mode 100644 index 000000000..7e8994dc6 --- /dev/null +++ b/pkg/integration/tests/bisect/mark_candidates_while_testing_merge_base.go @@ -0,0 +1,41 @@ +package bisect + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var MarkCandidatesWhileTestingMergeBase = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Mark the commits that the bisect hasn't ruled out yet while git tests the merge base of the good and the bad commit", + ExtraCmdArgs: []string{}, + Skip: false, + SetupRepo: func(shell *Shell) { + shell. + CreateNCommits(2). + NewBranch("fixed"). + CreateNCommitsStartingAt(1, 3). + Checkout("master"). + CreateNCommitsStartingAt(2, 4). + // The good commit-03 is on another branch, so git checks out the + // merge base commit-02 to test first + StartBisect("master", "fixed") + }, + SetupConfig: func(cfg *config.AppConfig) { + cfg.GetUserConfig().Git.Log.ShowGraph = "never" + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + IsFocused(). + Lines( + Contains("CI commit-05").Contains("<-- bad"), + /* EXPECTED: + MatchesRegexp(`\?.*commit-04`), + ACTUAL: */ + Contains("CI commit-04").DoesNotContain("?"), + Contains("CI commit-02").Contains("<-- current").IsSelected(), + // This is an ancestor of the good commit-03, so the bisect has + // ruled it out + Contains("CI commit-01").DoesNotContain("?"), + ) + }, +}) diff --git a/pkg/integration/tests/bisect/select_current_commit_in_long_range.go b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go index 09794c59f..5f0caa183 100644 --- a/pkg/integration/tests/bisect/select_current_commit_in_long_range.go +++ b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go @@ -8,7 +8,7 @@ import ( ) var SelectCurrentCommitInLongRange = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Select the current bisect commit when it is further down than the commits that we load at first", + Description: "Select the current bisect commit when it is further down than the commits that we load at first, and mark the commits around it that the bisect hasn't ruled out yet", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { @@ -23,6 +23,14 @@ var SelectCurrentCommitInLongRange = NewIntegrationTest(NewIntegrationTestArgs{ Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). - SelectedLine(Contains("<-- current")) + SelectedLine(Contains("<-- current")). + // The commits between the current one and the good one are still + // to be tested. The good one is further down than the commits that + // we load. + SelectNextItem(). + /* EXPECTED: + SelectedLine(Contains("?")) + ACTUAL: */ + SelectedLine(DoesNotContain("?")) }, }) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 4122c1188..acbe5b445 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -39,6 +39,7 @@ var tests = []*components.IntegrationTest{ bisect.CheckOutBranchBeforeBisecting, bisect.ChooseTerms, bisect.FromOtherBranch, + bisect.MarkCandidatesWhileTestingMergeBase, bisect.OfferResetWhenMergeBaseIsBad, bisect.SelectCurrentCommit, bisect.SelectCurrentCommitInLongRange,