From 6a9fe2e604f375732bfdb9cbd02148020a817079 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 9 Jul 2025 11:28:08 +0200 Subject: [PATCH] Remove obsolete tests These only ran for git versions that we no longer support. --- .../move_to_earlier_commit_no_keep_empty.go | 78 ------------------- ...move_to_new_commit_before_no_keep_empty.go | 77 ------------------ pkg/integration/tests/test_list.go | 2 - 3 files changed, 157 deletions(-) delete mode 100644 pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go delete mode 100644 pkg/integration/tests/patch_building/move_to_new_commit_before_no_keep_empty.go diff --git a/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go b/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go deleted file mode 100644 index e3a9003c0..000000000 --- a/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go +++ /dev/null @@ -1,78 +0,0 @@ -package patch_building - -import ( - "github.com/jesseduffield/lazygit/pkg/config" - . "github.com/jesseduffield/lazygit/pkg/integration/components" -) - -var MoveToEarlierCommitNoKeepEmpty = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Move a patch from a commit to an earlier commit, for older git versions that don't keep the empty commit", - ExtraCmdArgs: []string{}, - Skip: false, - GitVersion: Before("2.26.0"), - SetupConfig: func(config *config.AppConfig) {}, - SetupRepo: func(shell *Shell) { - shell.CreateDir("dir") - shell.CreateFileAndAdd("dir/file1", "file1 content") - shell.CreateFileAndAdd("dir/file2", "file2 content") - shell.Commit("first commit") - - shell.CreateFileAndAdd("unrelated-file", "") - shell.Commit("destination commit") - - shell.UpdateFileAndAdd("dir/file1", "file1 content with old changes") - shell.DeleteFileAndAdd("dir/file2") - shell.CreateFileAndAdd("dir/file3", "file3 content") - shell.Commit("commit to move from") - }, - Run: func(t *TestDriver, keys config.KeybindingConfig) { - t.Views().Commits(). - Focus(). - Lines( - Contains("commit to move from").IsSelected(), - Contains("destination commit"), - Contains("first commit"), - ). - PressEnter() - - t.Views().CommitFiles(). - IsFocused(). - Lines( - Contains("dir").IsSelected(), - Contains(" M file1"), - Contains(" D file2"), - Contains(" A file3"), - ). - PressPrimaryAction(). - PressEscape() - - t.Views().Information().Content(Contains("Building patch")) - - t.Views().Commits(). - IsFocused(). - SelectNextItem() - - t.Common().SelectPatchOption(Contains("Move patch to selected commit")) - - t.Views().Commits(). - IsFocused(). - Lines( - Contains("destination commit"), - Contains("first commit").IsSelected(), - ). - SelectPreviousItem(). - PressEnter() - - t.Views().CommitFiles(). - IsFocused(). - Lines( - Equals("▼ /").IsSelected(), - Equals(" ▼ dir"), - Equals(" M file1"), - Equals(" D file2"), - Equals(" A file3"), - Equals(" A unrelated-file"), - ). - PressEscape() - }, -}) diff --git a/pkg/integration/tests/patch_building/move_to_new_commit_before_no_keep_empty.go b/pkg/integration/tests/patch_building/move_to_new_commit_before_no_keep_empty.go deleted file mode 100644 index bf4e278ef..000000000 --- a/pkg/integration/tests/patch_building/move_to_new_commit_before_no_keep_empty.go +++ /dev/null @@ -1,77 +0,0 @@ -package patch_building - -import ( - "github.com/jesseduffield/lazygit/pkg/config" - . "github.com/jesseduffield/lazygit/pkg/integration/components" -) - -var MoveToNewCommitBeforeNoKeepEmpty = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Move a patch from a commit to a new commit before the original one, for older git versions that don't keep the empty commit", - ExtraCmdArgs: []string{}, - Skip: false, - GitVersion: Before("2.26.0"), - SetupConfig: func(config *config.AppConfig) {}, - SetupRepo: func(shell *Shell) { - shell.CreateDir("dir") - shell.CreateFileAndAdd("dir/file1", "file1 content") - shell.CreateFileAndAdd("dir/file2", "file2 content") - shell.Commit("first commit") - - shell.UpdateFileAndAdd("dir/file1", "file1 content with old changes") - shell.DeleteFileAndAdd("dir/file2") - shell.CreateFileAndAdd("dir/file3", "file3 content") - shell.Commit("commit to move from") - - shell.UpdateFileAndAdd("dir/file1", "file1 content with new changes") - shell.Commit("third commit") - }, - Run: func(t *TestDriver, keys config.KeybindingConfig) { - t.Views().Commits(). - Focus(). - Lines( - Contains("third commit").IsSelected(), - Contains("commit to move from"), - Contains("first commit"), - ). - SelectNextItem(). - PressEnter() - - t.Views().CommitFiles(). - IsFocused(). - Lines( - Contains("dir").IsSelected(), - Contains(" M file1"), - Contains(" D file2"), - Contains(" A file3"), - ). - PressPrimaryAction(). - PressEscape() - - t.Views().Information().Content(Contains("Building patch")) - - t.Common().SelectPatchOption(Contains("Move patch into new commit before the original commit")) - - t.ExpectPopup().CommitMessagePanel(). - InitialText(Equals("")). - Type("new commit").Confirm() - - t.Views().Commits(). - IsFocused(). - Lines( - Contains("third commit"), - Contains("new commit").IsSelected(), - Contains("first commit"), - ). - PressEnter() - - t.Views().CommitFiles(). - IsFocused(). - Lines( - Contains("dir").IsSelected(), - Contains(" M file1"), - Contains(" D file2"), - Contains(" A file3"), - ). - PressEscape() - }, -}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index fa5aff628..9de69d3b0 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -306,7 +306,6 @@ var tests = []*components.IntegrationTest{ patch_building.MoveRangeToIndex, patch_building.MoveToEarlierCommit, patch_building.MoveToEarlierCommitFromAddedFile, - patch_building.MoveToEarlierCommitNoKeepEmpty, patch_building.MoveToIndex, patch_building.MoveToIndexFromAddedFileWithConflict, patch_building.MoveToIndexPartOfAdjacentAddedLines, @@ -318,7 +317,6 @@ var tests = []*components.IntegrationTest{ patch_building.MoveToLaterCommitPartialHunk, patch_building.MoveToNewCommit, patch_building.MoveToNewCommitBefore, - patch_building.MoveToNewCommitBeforeNoKeepEmpty, patch_building.MoveToNewCommitFromAddedFile, patch_building.MoveToNewCommitFromDeletedFile, patch_building.MoveToNewCommitInLastCommitOfStackedBranch,