Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Basic = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a git bisect to find a bad commit", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. NewBranch("mybranch"). CreateNCommits(10) }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { markCommitAsBad := func() { t.Views().Commits(). Press(keys.Commits.ViewBisectOptions) t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as bad`)).Confirm() } markCommitAsGood := func() { t.Views().Commits(). Press(keys.Commits.ViewBisectOptions) t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm() } t.Views().Commits(). Focus(). SelectedLine(Contains("CI commit-10")). NavigateToLine(Contains("CI commit-09")). Tap(func() { markCommitAsBad() t.Views().Information().Content(Contains("Bisecting")) }). SelectedLine(Contains("<-- bad")). NavigateToLine(Contains("CI commit-02")). Tap(markCommitAsGood). TopLines(Contains("CI commit-10")). SelectedLine(Contains("CI commit-05").Contains("<-- current")). Tap(markCommitAsBad). SelectedLine(Contains("CI commit-04").Contains("<-- current")). Tap(func() { markCommitAsGood() t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-05.*Do you want to reset")).Confirm() }). IsFocused(). Content(Contains("CI commit-04")) t.Views().Information().Content(DoesNotContain("Bisecting")) }, })
View Source
var CheckOutBranchBeforeBisecting = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Check out a different branch after marking a commit as good, but before marking one as bad", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). NewBranch("feature"). CreateNCommitsStartingAt(3, 4). Checkout("master") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLine(Contains("CI commit-03")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm() }). Lines( Contains("CI commit-03").Contains("<-- good"), Contains("CI commit-02"), Contains("CI commit-01"), ) t.Views().Branches(). Focus(). NavigateToLine(Contains("feature")). PressPrimaryAction(). Lines( Contains("* feature"), Contains("master"), ) t.Views().Commits(). Lines( Contains("CI commit-06"), Contains("CI commit-05"), Contains("CI commit-04"), Contains("CI commit-03").Contains("<-- good"), Contains("CI commit-02"), Contains("CI commit-01"), ) }, })
View Source
var ChooseTerms = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a git bisect by choosing 'broken/fixed' as bisect terms", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. NewBranch("mybranch"). CreateNCommits(10) }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { markCommitAsFixed := func() { t.Views().Commits(). Press(keys.Commits.ViewBisectOptions) t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as fixed`)).Confirm() } markCommitAsBroken := func() { t.Views().Commits(). Press(keys.Commits.ViewBisectOptions) t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as broken`)).Confirm() } t.Views().Commits(). Focus(). SelectedLine(Contains("CI commit-10")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(Contains("Choose bisect terms")).Confirm() t.ExpectPopup().Prompt().Title(Equals("Term for old/good commit:")).Type("broken").Confirm() t.ExpectPopup().Prompt().Title(Equals("Term for new/bad commit:")).Type("fixed").Confirm() }). NavigateToLine(Contains("CI commit-09")). Tap(markCommitAsFixed). SelectedLine(Contains("<-- fixed")). NavigateToLine(Contains("CI commit-02")). Tap(markCommitAsBroken). Lines( Contains("CI commit-10").DoesNotContain("<--"), Contains("CI commit-09").Contains("<-- fixed"), Contains("CI commit-08").DoesNotContain("<--"), Contains("CI commit-07").DoesNotContain("<--"), Contains("CI commit-06").DoesNotContain("<--"), Contains("CI commit-05").Contains("<-- current").IsSelected(), Contains("CI commit-04").DoesNotContain("<--"), Contains("CI commit-03").DoesNotContain("<--"), Contains("CI commit-02").Contains("<-- broken"), Contains("CI commit-01").DoesNotContain("<--"), ). Tap(markCommitAsFixed). SelectedLine(Contains("CI commit-04").Contains("<-- current")). Tap(func() { markCommitAsBroken() t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-05.*Do you want to reset")).Confirm() }). IsFocused(). Content(Contains("CI commit-04")) t.Views().Information().Content(DoesNotContain("Bisecting")) }, })
View Source
var FromOtherBranch = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Opening lazygit when bisect has been started from another branch", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. EmptyCommit("only commit on master"). NewBranch("other"). CreateNCommits(10). Checkout("master"). StartBisect("other~2", "other~5") }, SetupConfig: func(cfg *config.AppConfig) {}, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Information().Content(Contains("Bisecting")) t.Views().Commits(). Focus(). TopLines( MatchesRegexp(`<-- bad.*commit-08`), MatchesRegexp(`<-- current.*commit-07`).IsSelected(), MatchesRegexp(`\?.*commit-06`), MatchesRegexp(`<-- good.*commit-05`), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm() t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-08.*Do you want to reset")).Confirm() t.Views().Information().Content(DoesNotContain("Bisecting")) }). Lines( Contains("only commit on master"), ) }, })
View Source
var GotoBottom = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Go to the bottom of the commits list in steps, stopping only at the bad commit, the current commit, and the first good commit", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). NewBranch("mybranch"). CreateNCommitsStartingAt(7, 4). StartBisect("HEAD~1", "HEAD~8") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). Lines( Contains("CI commit-10"), Contains("CI commit-09").Contains("<-- bad"), Contains("CI commit-08"), Contains("CI commit-07"), Contains("CI commit-06"), Contains("CI commit-05").Contains("<-- current").IsSelected(), Contains("CI commit-04"), Contains("CI commit-03"), Contains("CI commit-02").Contains("<-- good"), Contains("CI commit-01"), ). Press(keys.Universal.GotoTop). Press(keys.Universal.GotoBottom). SelectedLine(Contains("CI commit-09")). Press(keys.Universal.GotoBottom). SelectedLine(Contains("CI commit-05")). Press(keys.Universal.GotoBottom). SelectedLine(Contains("CI commit-02")). Press(keys.Universal.GotoBottom). SelectedLine(Contains("CI commit-01")) }, })
View Source
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). 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"), MatchesRegexp(`\?.*commit-04`), Contains("CI commit-02").Contains("<-- current").IsSelected(), Contains("CI commit-01").DoesNotContain("?"), ) }, })
View Source
var OfferResetWhenMergeBaseIsBad = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Offer to reset instead of showing the bisect menu when git stopped because the merge base is bad", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(2). NewBranch("fixed"). CreateNCommitsStartingAt(1, 3). Checkout("master"). CreateNCommitsStartingAt(2, 4). StartBisect("master", "fixed"). RunCommandExpectError([]string{"git", "bisect", "bad"}) }, 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("CI commit-04"), Contains("CI commit-02").Contains("<-- bad").IsSelected(), Contains("CI commit-01"), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Confirmation().Title(Equals("Reset 'git bisect'")).Content(Equals("Are you sure you want to reset 'git bisect'?")).Cancel() }) }, })
View Source
var SelectCurrentCommit = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Select the current bisect commit whenever it changes, but not on every refresh", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(10). StartBisect("HEAD", "HEAD~9") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLine(Contains("CI commit-05").Contains("<-- current")). NavigateToLine(Contains("CI commit-08")). Tap(func() { t.RefreshInBackground() }). SelectedLine(Contains("CI commit-08")). Tap(func() { t.Shell().RunCommand([]string{"git", "bisect", "good"}) t.RefreshInBackground() }). SelectedLine(Contains("CI commit-07").Contains("<-- current")) }, })
View Source
var SelectCurrentCommitInLongRange = NewIntegrationTest(NewIntegrationTestArgs{ 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) { for i := range 700 { shell.EmptyCommit(fmt.Sprintf("commit %03d", i+1)) } shell.StartBisect("HEAD", "HEAD~699") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLine(Contains("<-- current")). SelectNextItem(). SelectedLine(Contains("?")) }, })
View Source
var SelectFirstBadCommit = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Select the first bad commit when marking the last commit to test finishes the bisect", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(10). StartBisect("HEAD~2", "HEAD~5") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). IsFocused(). TopLines( Contains("CI commit-10"), Contains("CI commit-09"), Contains("CI commit-08").Contains("<-- bad"), Contains("CI commit-07").Contains("<-- current").IsSelected(), Contains("CI commit-06"), Contains("CI commit-05").Contains("<-- good"), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm() t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-08.*Do you want to reset")).Cancel() }). TopLines( Contains("CI commit-10"), Contains("CI commit-09"), Contains("CI commit-08").Contains("<-- bad").IsSelected(), Contains("CI commit-07").Contains("<-- good"), Contains("CI commit-06"), Contains("CI commit-05").Contains("<-- good"), ) }, })
View Source
var SelectFirstBadCommitOnStartup = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Select the first bad commit when starting with a finished bisect", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(10). StartBisect("HEAD~2", "HEAD~5"). RunCommand([]string{"git", "bisect", "good"}) }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). IsFocused(). SelectedLine(Contains("CI commit-08").Contains("<-- bad")) }, })
View Source
var ShowResultAgain = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Show the result of a finished bisect again instead of the bisect menu", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(10). StartBisect("HEAD~2", "HEAD~5"). RunCommand([]string{"git", "bisect", "good"}) }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). IsFocused(). SelectedLine(Contains("CI commit-08").Contains("<-- bad")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-08.*Do you want to reset")).Cancel() }) t.Views().Branches(). Focus(). Press(keys.Commits.ViewBisectOptions) t.ExpectToast(Equals("Disabled: Bisecting is in progress; use the commits panel")) }, })
View Source
var ShowResultWhenFoundRightAway = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Show the result instead of the bisect menu when git found the first bad commit without testing any", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). StartBisect("HEAD", "HEAD~1") }, 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-03").Contains("<-- bad").IsSelected(), Contains("CI commit-02").Contains("<-- good"), Contains("CI commit-01"), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit-03.*Do you want to reset")).Cancel() }) t.Views().Branches(). Focus(). Press(keys.Commits.ViewBisectOptions) t.ExpectToast(Equals("Disabled: Bisecting is in progress; use the commits panel")) }, })
View Source
var Skip = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a git bisect and skip a few commits (selected or current)", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(10) }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Focus(). SelectedLine(Contains("commit-10")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as bad`)).Confirm() }). NavigateToLine(Contains("commit-01")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark commit").Contains("as bad"), Contains("g Mark commit").Contains("as good"), Contains("s Skip commit"), Contains("r Reset bisect"), Contains("Cancel"), ). Select(MatchesRegexp(`Mark .* as good`)).Confirm() t.Views().Information().Content(Contains("Bisecting")) }). Lines( Contains("CI commit-10").Contains("<-- bad"), Contains("CI commit-09").DoesNotContain("<--"), Contains("CI commit-08").DoesNotContain("<--"), Contains("CI commit-07").DoesNotContain("<--"), Contains("CI commit-06").DoesNotContain("<--"), Contains("CI commit-05").Contains("<-- current").IsSelected(), Contains("CI commit-04").DoesNotContain("<--"), Contains("CI commit-03").DoesNotContain("<--"), Contains("CI commit-02").DoesNotContain("<--"), Contains("CI commit-01").Contains("<-- good"), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark current commit").Contains("as bad"), Contains("g Mark current commit").Contains("as good"), Contains("s Skip current commit"), Contains("r Reset bisect"), Contains("Cancel"), ). Select(Contains("Skip current commit")).Confirm() }). Lines( Contains("CI commit-10").Contains("<-- bad"), Contains("CI commit-09").DoesNotContain("<--"), Contains("CI commit-08").DoesNotContain("<--"), Contains("CI commit-07").DoesNotContain("<--"), Contains("CI commit-06").Contains("<-- current").IsSelected(), Contains("CI commit-05").Contains("<-- skipped"), Contains("CI commit-04").DoesNotContain("<--"), Contains("CI commit-03").DoesNotContain("<--"), Contains("CI commit-02").DoesNotContain("<--"), Contains("CI commit-01").Contains("<-- good"), ). NavigateToLine(Contains("commit-07")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark current commit").Contains("as bad"), Contains("g Mark current commit").Contains("as good"), Contains("s Skip current commit"), Contains("S Skip selected commit"), Contains("r Reset bisect"), Contains("Cancel"), ). Select(Contains("Skip selected commit")).Confirm() }). SelectedLine(Contains("CI commit-07").Contains("<-- skipped")) }, })
View Source
var StartFromBranches = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a bisect by marking the heads of two branches as good and bad in the branches panel", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). NewBranch("feature"). CreateNCommitsStartingAt(6, 4). Checkout("master") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). Focus(). Lines( Contains("master").IsSelected(), Contains("feature"), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark branch 'master' as bad (start bisect)"), Contains("g Mark branch 'master' as good (start bisect)"), Contains("t Choose bisect terms"), Contains("Cancel"), ). Select(Contains("as good")).Confirm() t.Views().Information().Content(Contains("Bisecting")) }). NavigateToLine(Contains("feature")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark branch 'feature' as bad"), Contains("g Mark branch 'feature' as good"), Contains("r Reset bisect"), Contains("Cancel"), ). Select(Contains("as bad")).Confirm() }) t.Views().Commits(). IsFocused(). Lines( Contains("CI commit-09").Contains("<-- bad"), Contains("CI commit-08"), Contains("CI commit-07"), Contains("CI commit-06").Contains("<-- current").IsSelected(), Contains("CI commit-05"), Contains("CI commit-04"), Contains("CI commit-03").Contains("<-- good"), Contains("CI commit-02"), Contains("CI commit-01"), ) t.Views().Branches(). Focus(). Press(keys.Commits.ViewBisectOptions) t.ExpectToast(Equals("Disabled: Bisecting is in progress; use the commits panel")) }, })
View Source
var StartFromSubCommitsAndReflog = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a bisect by marking a commit of a branch as bad and a reflog entry as good", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). NewBranch("feature"). CreateNCommitsStartingAt(3, 4). Checkout("master") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). Focus(). NavigateToLine(Contains("feature")). PressEnter() t.Views().SubCommits(). IsFocused(). SelectedLine(Contains("CI commit-06")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( MatchesRegexp(`b Mark commit [0-9a-f]+ as bad \(start bisect\)`), MatchesRegexp(`g Mark commit [0-9a-f]+ as good \(start bisect\)`), Contains("t Choose bisect terms"), Contains("Cancel"), ). Select(Contains("as bad")).Confirm() }). PressEscape() t.Views().ReflogCommits(). Focus(). NavigateToLine(Contains("commit-01")). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( MatchesRegexp(`b Mark commit [0-9a-f]+ as bad`), MatchesRegexp(`g Mark commit [0-9a-f]+ as good`), Contains("r Reset bisect"), Contains("Cancel"), ). Select(Contains("as good")).Confirm() }) t.Views().Commits(). IsFocused(). Lines( Contains("CI commit-06").Contains("<-- bad"), Contains("CI commit-05"), Contains("CI commit-04"), Contains("CI commit-03").Contains("<-- current").IsSelected(), Contains("CI commit-02"), Contains("CI commit-01").Contains("<-- good"), ) }, })
View Source
var StartFromTagsAndRemoteBranches = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Start a bisect by marking a tag as good and a remote branch as bad", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(2). CreateLightweightTag("v1.0", "HEAD"). CreateNCommitsStartingAt(4, 3). CloneIntoRemote("origin"). HardReset("HEAD~2") }, SetupConfig: func(cfg *config.AppConfig) { cfg.GetUserConfig().Git.Log.ShowGraph = "never" }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Tags(). Focus(). Lines( Contains("v1.0").IsSelected(), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark tag 'v1.0' as bad (start bisect)"), Contains("g Mark tag 'v1.0' as good (start bisect)"), Contains("t Choose bisect terms"), Contains("Cancel"), ). Select(Contains("as good")).Confirm() }) t.Views().Remotes(). Focus(). Lines( Contains("origin").IsSelected(), ). PressEnter() t.Views().RemoteBranches(). IsFocused(). Lines( Contains("master").IsSelected(), ). Press(keys.Commits.ViewBisectOptions). Tap(func() { t.ExpectPopup().Menu().Title(Equals("Bisect")). Lines( Contains("b Mark branch 'origin/master' as bad"), Contains("g Mark branch 'origin/master' as good"), Contains("r Reset bisect"), Contains("Cancel"), ). Select(Contains("as bad")).Confirm() }) t.Views().Commits(). IsFocused(). Lines( Contains("CI commit-06").Contains("<-- bad"), Contains("CI commit-05"), Contains("CI commit-04").Contains("<-- current").IsSelected(), Contains("CI commit-03"), Contains("CI v1.0 commit-02").Contains("<-- good"), Contains("CI commit-01"), ) }, })
View Source
var StartInCommitsPanel = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Focus the commits panel at startup when a bisect is in progress", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. CreateNCommits(3). RunCommand([]string{"git", "bisect", "start"}). RunCommand([]string{"git", "bisect", "bad"}) }, 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-03").Contains("<-- bad").IsSelected(), Contains("CI commit-02"), Contains("CI commit-01"), ) }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files
¶
- basic.go
- check_out_branch_before_bisecting.go
- choose_terms.go
- from_other_branch.go
- goto_bottom.go
- mark_candidates_while_testing_merge_base.go
- offer_reset_when_merge_base_is_bad.go
- select_current_commit.go
- select_current_commit_in_long_range.go
- select_first_bad_commit.go
- select_first_bad_commit_on_startup.go
- show_result_again.go
- show_result_when_found_right_away.go
- skip.go
- start_from_branches.go
- start_from_sub_commits_and_reflog.go
- start_from_tags_and_remote_branches.go
- start_in_commits_panel.go
Click to show internal directories.
Click to hide internal directories.