From ae07cf55066b826261ef16b9e40334694831b8d7 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 13:01:32 +1100 Subject: [PATCH 1/5] migrate discard old file change test --- .../tests/commit/discard_old_file_change.go | 57 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/ORIG_HEAD | 1 - .../expected/repo/.git_keep/config | 10 --- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 334 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 --- .../expected/repo/.git_keep/logs/HEAD | 9 --- .../repo/.git_keep/logs/refs/heads/master | 4 -- .../00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 | Bin 127 -> 0 bytes .../0a/91dcf3772f7fd7409b3df04eb6ef177219303a | 1 - .../0c/db6daba7e25b6d6d10da326e0ab74401021370 | 2 - .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../18/e987d34afb121659724591cd709e2a789184fc | Bin 152 -> 0 bytes .../1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 | Bin 50 -> 0 bytes .../22/5ad83faa797c1831a2bc956a21e2d472f21443 | Bin 151 -> 0 bytes .../38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da | Bin 21 -> 0 bytes .../42/786aead9ca20a3427c38e5e5262fa787ce9868 | Bin 101 -> 0 bytes .../78/80a9728615a4d196df39600a0c8c71b40d96d6 | Bin 150 -> 0 bytes .../7b/8a8396be4352039598acb43acaadc1c380551f | Bin 21 -> 0 bytes .../9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c | Bin 101 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../af/6725ba23f43a286deff0747476d7874113df1e | 3 - .../b7/a702b642978f2a9b1af9c1c67b22127af78c92 | 2 - .../d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 | 2 - .../d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 | Bin 154 -> 0 bytes .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../discardOldFileChanges/expected/repo/file0 | 1 - .../discardOldFileChanges/expected/repo/file1 | 1 - .../discardOldFileChanges/expected/repo/file2 | 1 - .../discardOldFileChanges/expected/repo/file3 | 1 - .../discardOldFileChanges/recording.json | 1 - .../discardOldFileChanges/setup.sh | 26 -------- .../discardOldFileChanges/test.json | 4 -- 38 files changed, 58 insertions(+), 80 deletions(-) create mode 100644 pkg/integration/tests/commit/discard_old_file_change.go delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/config delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/description delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/index delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/18/e987d34afb121659724591cd709e2a789184fc delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/22/5ad83faa797c1831a2bc956a21e2d472f21443 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/42/786aead9ca20a3427c38e5e5262fa787ce9868 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/78/80a9728615a4d196df39600a0c8c71b40d96d6 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/7b/8a8396be4352039598acb43acaadc1c380551f delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/af/6725ba23f43a286deff0747476d7874113df1e delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/b7/a702b642978f2a9b1af9c1c67b22127af78c92 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/discardOldFileChanges/expected/repo/file0 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/file1 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/file2 delete mode 100644 test/integration/discardOldFileChanges/expected/repo/file3 delete mode 100644 test/integration/discardOldFileChanges/recording.json delete mode 100644 test/integration/discardOldFileChanges/setup.sh delete mode 100644 test/integration/discardOldFileChanges/test.json diff --git a/pkg/integration/tests/commit/discard_old_file_change.go b/pkg/integration/tests/commit/discard_old_file_change.go new file mode 100644 index 000000000..735dcca87 --- /dev/null +++ b/pkg/integration/tests/commit/discard_old_file_change.go @@ -0,0 +1,57 @@ +package commit + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var DiscardOldFileChange = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Discarding a single file from an old commit (does rebase in background to remove the file but retain the other one)", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.CreateFileAndAdd("file0", "file0") + shell.Commit("first commit") + + shell.CreateFileAndAdd("file1", "file2") + shell.CreateFileAndAdd("fileToRemove", "fileToRemove") + shell.Commit("commit to change") + + shell.CreateFileAndAdd("file3", "file3") + shell.Commit("third commit") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + Lines( + Contains("third commit").IsSelected(), + Contains("commit to change"), + Contains("first commit"), + ). + SelectNextItem(). + PressEnter() + + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains("file1").IsSelected(), + Contains("fileToRemove"), + ). + SelectNextItem(). + Press(keys.Universal.Remove) + + t.ExpectPopup().Confirmation(). + Title(Equals("Discard file changes")). + Content(Contains("Are you sure you want to discard this commit's changes to this file?")). + Confirm() + + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains("file1").IsSelected(), + ) + + t.FileSystem().PathNotPresent("fileToRemove") + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index d63b1aa50..c550c2a0c 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -45,6 +45,7 @@ var tests = []*components.IntegrationTest{ commit.Staged, commit.Unstaged, commit.StagedWithoutHooks, + commit.DiscardOldFileChange, custom_commands.Basic, custom_commands.FormPrompts, custom_commands.MenuFromCommand, diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 7b27632fe..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -twoFiles diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/FETCH_HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD deleted file mode 100644 index db70e637d..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -7880a9728615a4d196df39600a0c8c71b40d96d6 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/config b/test/integration/discardOldFileChanges/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/config +++ /dev/null @@ -1,10 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/description b/test/integration/discardOldFileChanges/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/index b/test/integration/discardOldFileChanges/expected/repo/.git_keep/index deleted file mode 100644 index 258123f2690e46dffe3212b5b74b2f09985c5d23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 334 zcmZ?q402{*U|<4bmc(2Bk&^v0+(5L1dhlyT1_oBfKYz3t7#f!_Ffe`vsu2NVHVYA} zD+~TbaR&OdHh#3 z^~RTo&?ugKrwajIE!|fk<`}}wk!i{>1)C?lVG`6FU37CKczzf)DD6A<#}Zg+uBBUj7=pjz~kyF$S9x l66ER%WUw*l8Y&oYxyU%ods+NGzS7%p&Yqrn>8H%RzX9AgX@CF# diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude b/test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index cd7bc3c77..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,9 +0,0 @@ -0000000000000000000000000000000000000000 b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697108 +1100 commit (initial): file0 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697108 +1100 commit: twoFiles -7880a9728615a4d196df39600a0c8c71b40d96d6 af6725ba23f43a286deff0747476d7874113df1e CI 1641697108 +1100 commit: file2 -af6725ba23f43a286deff0747476d7874113df1e af6725ba23f43a286deff0747476d7874113df1e CI 1641697111 +1100 rebase: updating HEAD -af6725ba23f43a286deff0747476d7874113df1e b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697111 +1100 rebase -i (start): checkout b7a702b642978f2a9b1af9c1c67b22127af78c92 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697111 +1100 rebase -i: fast-forward -7880a9728615a4d196df39600a0c8c71b40d96d6 d14505f281a54cda96fc5fb8cd4b4ee14bae6264 CI 1641697111 +1100 commit (amend): twoFiles -d14505f281a54cda96fc5fb8cd4b4ee14bae6264 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (pick): file2 -225ad83faa797c1831a2bc956a21e2d472f21443 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (finish): returning to refs/heads/master diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 13413542d..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697108 +1100 commit (initial): file0 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697108 +1100 commit: twoFiles -7880a9728615a4d196df39600a0c8c71b40d96d6 af6725ba23f43a286deff0747476d7874113df1e CI 1641697108 +1100 commit: file2 -af6725ba23f43a286deff0747476d7874113df1e 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (finish): refs/heads/master onto b7a702b642978f2a9b1af9c1c67b22127af78c92 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 deleted file mode 100644 index fd478c4af0b82b11f2e6efd8236e08e1d7775da8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 127 zcmV-_0D%8^0V^p=O;s>7HexU|FfcPQQAo?oNi|@w5V5+l;GfpEcfp6=cP_p8Xzx_h zTSy8F8J6yO{8u&g#+QiDD4u+$3jtm&-B*zm7%@oj{4i=z+IQ~dszu>d{VlJw=Ub>F hDTrdI?rNU4&pC*B>Wnp8tWK>xc(@@{9sq4%IiFROJFox% diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a deleted file mode 100644 index 2794a5840..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a +++ /dev/null @@ -1 +0,0 @@ -xj1DSW]iO+ \VD>s'C>?j҇n Wzd9Vc\3{Z3VeSD.>~-C >Eրi&*'&Ġ 폇%aZԨ*G)L"qvwl?V0̈^/w͙r~K \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 deleted file mode 100644 index 798edd72c..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E]$DDzi2iK㛍{yZ\ .%xJ~ZE#08nZNMgRZ+ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/18/e987d34afb121659724591cd709e2a789184fc b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/18/e987d34afb121659724591cd709e2a789184fc deleted file mode 100644 index b09179f5f9e382c598ecd8335310a677adca174c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152 zcmV;J0B8Sr0V^p=O;s>7Gi5L|FfcPQQAo?oNi|@w5V5+l;GfpEcfp6=cP_p8Xzx_h zTSy8F8J6yO{8u&g#+QiDD4u+$3jtm&-B*zm7%@oj{4i=z+IQ~dszu>d{VlJw=Ub>F zDKKWZpUta%rtH}p{!9W-v4`Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U I033l4YT~68jQ{`u diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/22/5ad83faa797c1831a2bc956a21e2d472f21443 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/22/5ad83faa797c1831a2bc956a21e2d472f21443 deleted file mode 100644 index f0e96277fe5213570b0eaf767739c2cad485060e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 151 zcmV;I0BHYs0e#L*3c@fDKw;N8MfQSZ#{5h{MChu=m`o;EXlyAFJicAHcKi4iPuAAv zZehSv-&O6PM4Vg^DuksV*IY|*kfPQ^3PgC#f?_t__0??wA6%$Nz`;x5Ayx@BlN6u5 zD)`JAF?z%A{#|y2)08mZ`J^%m! diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/42/786aead9ca20a3427c38e5e5262fa787ce9868 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/42/786aead9ca20a3427c38e5e5262fa787ce9868 deleted file mode 100644 index 2f0336f2f78abe1d8b22fbc13b813ab9bd5c41c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmV-r0Gj`J0V^p=O;xb8WH2-^Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U zND2%YmhO4{S2gvEM3q+2lSYk0*S`pgIRggXS0cz946mmq>zzg0?tuDJS9Xx z;!Hsz8h*D&-RwBo^Eh4g%Vk~kB(+>D_#S*DaKRn{oHM)Kr<(qmoA#-;M1& diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/7b/8a8396be4352039598acb43acaadc1c380551f b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/7b/8a8396be4352039598acb43acaadc1c380551f deleted file mode 100644 index 23756a36918446dfe237e35d6eb5086f74674bd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb=F1`6^?^M%U zND2%YmhO4{S2gv2WLwJR>kD diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/af/6725ba23f43a286deff0747476d7874113df1e b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/af/6725ba23f43a286deff0747476d7874113df1e deleted file mode 100644 index 44a1872c3..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/af/6725ba23f43a286deff0747476d7874113df1e +++ /dev/null @@ -1,3 +0,0 @@ -xA - @Ѯ=BqT(U1# & =~snekmp釪,R ^kr̩xrN*)])|#p -C$<LTK Qid_aާ_n7"H) D{E0S]M]V9n \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/b7/a702b642978f2a9b1af9c1c67b22127af78c92 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/b7/a702b642978f2a9b1af9c1c67b22127af78c92 deleted file mode 100644 index 8bcfe2c70..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/b7/a702b642978f2a9b1af9c1c67b22127af78c92 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0Fa9c#i`R"x|{޼tS\b6C*VToPS.}ki>NO|S{[{`Qx;1`7+ \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 +++ /dev/null @@ -1,2 +0,0 @@ -x+)JMU03c040031QHI5`ֶww.hT[H - yW5Ɨ(| ^-W(x9 \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 deleted file mode 100644 index 76e9da484fa451ad77e216da9664407a28edf23b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmV;L0A>Gp0ey}^3c@fD06pgwxeJorrr9ot2nC_f*lZIlw5HUEKHnZZdmV;hv@FY1 zEpU6NTS|6x6jWK&v8V`+O~_G6xXojeuyMh&4<5`aTY6L*NyuRg9+|p~!Vx61f(D9+ zfFzkZWi;}t_p;f3u;+fbrjIP^oK9Mni-o-xn80=R2;iLA={{A{e;weboBA%dX--e` I1xdL(2iG!4r~m)} diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f6f41f91b00976b4ff3f8f9935f7931e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb>`CU&08otwO#lD@ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master b/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 2ebac56f2..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -225ad83faa797c1831a2bc956a21e2d472f21443 diff --git a/test/integration/discardOldFileChanges/expected/repo/file0 b/test/integration/discardOldFileChanges/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/discardOldFileChanges/expected/repo/file1 b/test/integration/discardOldFileChanges/expected/repo/file1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/discardOldFileChanges/expected/repo/file2 b/test/integration/discardOldFileChanges/expected/repo/file2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/discardOldFileChanges/expected/repo/file3 b/test/integration/discardOldFileChanges/expected/repo/file3 deleted file mode 100644 index df6b0d2bc..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file3 +++ /dev/null @@ -1 +0,0 @@ -test3 diff --git a/test/integration/discardOldFileChanges/recording.json b/test/integration/discardOldFileChanges/recording.json deleted file mode 100644 index 0b9a99ec5..000000000 --- a/test/integration/discardOldFileChanges/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":635,"Mod":0,"Key":259,"Ch":0},{"Timestamp":899,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1227,"Mod":0,"Key":258,"Ch":0},{"Timestamp":1571,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1971,"Mod":0,"Key":258,"Ch":0},{"Timestamp":2322,"Mod":0,"Key":256,"Ch":100},{"Timestamp":2731,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3707,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/setup.sh b/test/integration/discardOldFileChanges/setup.sh deleted file mode 100644 index 5b592cabd..000000000 --- a/test/integration/discardOldFileChanges/setup.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -echo testZ > fileZ -git add . -git commit -am twoFiles - -echo test2 > file2 -git add . -git commit -am file2 - -echo test3 > file3 -git add . diff --git a/test/integration/discardOldFileChanges/test.json b/test/integration/discardOldFileChanges/test.json deleted file mode 100644 index 04a59a63c..000000000 --- a/test/integration/discardOldFileChanges/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Discarding a single file from an old commit (does rebase in background to remove the file but retain the other one)", - "speed": 5 -} From f2d0f362d438b965fc1871f07f8373c5ce0af453 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 13:24:23 +1100 Subject: [PATCH 2/5] migrate discard staged changes test --- pkg/integration/components/file_system.go | 23 ++++++++ .../tests/file/discard_staged_changes.go | 52 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/ORIG_HEAD | 1 - .../expected/repo/.git_keep/config | 8 --- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 262 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 6 -- .../expected/repo/.git_keep/logs/HEAD | 5 -- .../repo/.git_keep/logs/refs/heads/master | 3 - .../02/f629e46dbaa03b58196cced3df07b02c0daf22 | Bin 147 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 | Bin 50 -> 0 bytes .../22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 | 3 - .../38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da | Bin 21 -> 0 bytes .../5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 | Bin 81 -> 0 bytes .../5e/2f5743436bdc7602aa3486d5ff294940603c3d | Bin 198 -> 0 bytes .../66/bbc809cdafd867cf9320bfb7484bb8fa898448 | 3 - .../9d/b161bba78fbd20e7e4ae004be28e40d747726a | 2 - .../9e/7ff93a5c67a0ef098e9e436961746f333edf98 | 2 - .../9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c | Bin 101 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../c7/c7da3c64e86c3270f2639a1379e67e14891b6a | Bin 28 -> 0 bytes .../d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 | 2 - .../e3/18207cf3da045ce47e2632a5326b61030a2c8e | Bin 189 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../discardStagedFiles/expected/repo/file0 | 1 - .../discardStagedFiles/expected/repo/file1 | 1 - .../discardStagedFiles/expected/repo/file2 | 1 - .../discardStagedFiles/expected/repo/file3 | 1 - .../discardStagedFiles/recording.json | 1 - test/integration/discardStagedFiles/setup.sh | 26 --------- test/integration/discardStagedFiles/test.json | 1 - 36 files changed, 76 insertions(+), 71 deletions(-) create mode 100644 pkg/integration/tests/file/discard_staged_changes.go delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/config delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/description delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/index delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/c7/c7da3c64e86c3270f2639a1379e67e14891b6a delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/objects/e3/18207cf3da045ce47e2632a5326b61030a2c8e delete mode 100644 test/integration/discardStagedFiles/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/discardStagedFiles/expected/repo/file0 delete mode 100644 test/integration/discardStagedFiles/expected/repo/file1 delete mode 100644 test/integration/discardStagedFiles/expected/repo/file2 delete mode 100644 test/integration/discardStagedFiles/expected/repo/file3 delete mode 100644 test/integration/discardStagedFiles/recording.json delete mode 100644 test/integration/discardStagedFiles/setup.sh delete mode 100644 test/integration/discardStagedFiles/test.json diff --git a/pkg/integration/components/file_system.go b/pkg/integration/components/file_system.go index 040234e77..ea9a2e929 100644 --- a/pkg/integration/components/file_system.go +++ b/pkg/integration/components/file_system.go @@ -24,3 +24,26 @@ func (self *FileSystem) PathNotPresent(path string) { return os.IsNotExist(err), fmt.Sprintf("Expected path '%s' to not exist, but it does", path) }) } + +// Asserts that the file at the given path has the given content +func (self *FileSystem) FileContainsContent(path string, matcher *matcher) { + self.assertWithRetries(func() (bool, string) { + _, err := os.Stat(path) + if os.IsNotExist(err) { + return false, fmt.Sprintf("Expected path '%s' to not exist, but it does", path) + } + + output, err := os.ReadFile(path) + if err != nil { + return false, fmt.Sprintf("Expected error when reading file content at path '%s': %s", path, err.Error()) + } + + strOutput := string(output) + + if ok, errMsg := matcher.context("").test(strOutput); !ok { + return false, fmt.Sprintf("Unexpected content in file %s: %s", path, errMsg) + } + + return true, "" + }) +} diff --git a/pkg/integration/tests/file/discard_staged_changes.go b/pkg/integration/tests/file/discard_staged_changes.go new file mode 100644 index 000000000..180dc45b4 --- /dev/null +++ b/pkg/integration/tests/file/discard_staged_changes.go @@ -0,0 +1,52 @@ +package file + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var DiscardStagedChanges = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Discarding staged changes", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + shell.CreateFileAndAdd("fileToRemove", "original content") + shell.CreateFileAndAdd("file2", "original content") + shell.Commit("first commit") + + shell.CreateFile("file3", "original content") + shell.UpdateFile("fileToRemove", "new content") + shell.UpdateFile("file2", "new content") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + IsFocused(). + Lines( + Contains(` M file2`).IsSelected(), + Contains(` M fileToRemove`), + Contains(`?? file3`), + ). + SelectNextItem(). + PressPrimaryAction(). + Lines( + Contains(` M file2`), + Contains(`M fileToRemove`).IsSelected(), + Contains(`?? file3`), + ). + Press(keys.Files.ViewResetOptions) + + t.ExpectPopup().Menu().Title(Equals("")).Select(Contains("discard staged changes")).Confirm() + + // staged file has been removed + t.Views().Files(). + Lines( + Contains(` M file2`), + Contains(`?? file3`).IsSelected(), + ) + + // the file should have the same content that it originally had, given that that was committed already + t.FileSystem().FileContainsContent("fileToRemove", Equals("original content")) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index c550c2a0c..9278ade2b 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -53,6 +53,7 @@ var tests = []*components.IntegrationTest{ custom_commands.MultiplePrompts, file.DirWithUntrackedFile, file.DiscardChanges, + file.DiscardStagedChanges, interactive_rebase.AmendMerge, interactive_rebase.One, stash.Rename, diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 6c493ff74..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -file2 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/FETCH_HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD deleted file mode 100644 index c3e34c41d..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -02f629e46dbaa03b58196cced3df07b02c0daf22 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/config b/test/integration/discardStagedFiles/expected/repo/.git_keep/config deleted file mode 100644 index 596ebaeb3..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/description b/test/integration/discardStagedFiles/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/index b/test/integration/discardStagedFiles/expected/repo/.git_keep/index deleted file mode 100644 index be47b03227c3338590ec668645dbca0f8610495c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmZ?q402{*U|<4b=A`nK`lih%Zo+7wm=vS%I$;Ke#w9@M7ZA+AW+7sAWx+qKZSR5) zz3*Il^U>a^rneYa(=u~X4S-tk0gyQeuyoJkzpAM>zC?sZ@#H&Q2=Hp@z6vqN5TOVw z3)LJ6o*zaHO8d^eT(u~?s=wux_IwLi|1=T+Kf^#< diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude b/test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 9afe44c14..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 22f24c5fcc97c1ff826ecb66b60bdc01937f6052 CI 1652009263 +0200 commit (initial): file0 -22f24c5fcc97c1ff826ecb66b60bdc01937f6052 9e7ff93a5c67a0ef098e9e436961746f333edf98 CI 1652009263 +0200 commit: file1 -9e7ff93a5c67a0ef098e9e436961746f333edf98 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009263 +0200 commit: file2 -02f629e46dbaa03b58196cced3df07b02c0daf22 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009266 +0200 reset: moving to HEAD -02f629e46dbaa03b58196cced3df07b02c0daf22 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009266 +0200 reset: moving to HEAD diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index e5e4b05c6..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 22f24c5fcc97c1ff826ecb66b60bdc01937f6052 CI 1652009263 +0200 commit (initial): file0 -22f24c5fcc97c1ff826ecb66b60bdc01937f6052 9e7ff93a5c67a0ef098e9e436961746f333edf98 CI 1652009263 +0200 commit: file1 -9e7ff93a5c67a0ef098e9e436961746f333edf98 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009263 +0200 commit: file2 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 deleted file mode 100644 index 5dd10885d211e1167ef8d7849fc3cbb25d8e9983..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmV;E0Brww0gaA93d0}}0DJZo-U~(7M0cT-LQZ+cMt5l-HX&H(^Xn6O8-_Vd-fLZ( z^#qr8idYgvPOfAu2&Dk)qGfbGMbU)f5g{xYvN`yack6vprNCp3iJhn;6p|rCiarfd zLkLoo(D0|d_R~(Yy-)K~zFdz@Zh5Z{>*EN{5yW7xu9NAuPc`{7H@a>D<_FBGIqQ6K BL~ZE#08nZNMgRZ+ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 deleted file mode 100644 index 79fcadf67fdecb0f0cffca7ff27b2ae5c031e4d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmV-20L}k+0V^p=O;s>9W-v4`Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U I033l4YT~68jQ{`u diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 deleted file mode 100644 index f4e1952b1..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 +++ /dev/null @@ -1,3 +0,0 @@ -x -0=+.&ݦ.=3 )%o>0 ZKYK;২)q!Y1KfSv -Qg§IByyʱ$GǬtN>i37y2+ \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da deleted file mode 100644 index 06c9cb73d7a8ed6841ce407bd6bb15235c8fa15c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb|y2)08mZ`J^%m! diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 deleted file mode 100644 index 6a6f2436255b8a831b87262c4d030c7d63af046b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 81 zcmV-X0IvUd0V^p=O;xb8WH2-^Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U nND2%Yjvv2elky_RsNhrbEaA#$bt0Y8Sx5?uuqprm;XNz0$Rj03 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d deleted file mode 100644 index 7aee98aa9a564f30376587951581c8472747d52f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmV;%06G770gaDAN&`UhpYDPu1Y{rRcb$fKD?sa6O*dQe9U<|H1l#1JE~4*Jnf%L<1hJRXkE{;Bir z;tzS5pJ3!2Atqvmd+clIw4Z4HPknf~!mL~O_wahr@2~fBdxNd%c7os353$Qq*X#;i AWdHyG diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 deleted file mode 100644 index c84b87a17..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 +++ /dev/null @@ -1,3 +0,0 @@ -x+)JMUd040031QHI5`ֶww.hT[H - e"ǨS,gu"YH -$x~5(;rբW-Ж+^ \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a deleted file mode 100644 index c5c3d1d48..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a +++ /dev/null @@ -1,2 +0,0 @@ -x -0D=+.vn<3 -5o.޽ üŵu,BNǘ}O(YF묈yg3[uZN2sqȄw};'ܧ~BٞzkB!zb#dZۤ97%uYAJ  BP \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 deleted file mode 100644 index 1c2077cd7..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E] 2$"BW=F2D>K."A" p)=F1`6^?^M%U zND2%YmhO4{S2gv2WLwJR>kD diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/c7/c7da3c64e86c3270f2639a1379e67e14891b6a b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/c7/c7da3c64e86c3270f2639a1379e67e14891b6a deleted file mode 100644 index ee4385f12cb5e2fea6044749c3960a2c40be7b9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28 kcmb4eAGlPAM9PI~BiJ!N8W-osW20IwDcng9R* diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 +++ /dev/null @@ -1,2 +0,0 @@ -x+)JMU03c040031QHI5`ֶww.hT[H - yW5Ɨ(| ^-W(x9 \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/e3/18207cf3da045ce47e2632a5326b61030a2c8e b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/e3/18207cf3da045ce47e2632a5326b61030a2c8e deleted file mode 100644 index 80258c14d84beb0bf8a3919bd3f90707c3ee3540..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 189 zcmV;u07CzG0gaEbY6LM11yk==s1F2L>y_6>2!X4%OP5-*WO8u6JvI*H^W*0FbdSeO zF=cP<(t((s`r!^s@tUQ&u*}KUTr(|B(Y2-^=0$n7P%%w+IsDcEsWN4cY$}4YE^EkK zirZ|1Qlx?=mFU4|)4)Mh(puFBJ$V#IjOw&{L`yLxVwvQpf9(gHH+Vg7@BS<8e)X5K rw>Jp95Mm}~c*e1&@s5b@|HP-y?F053H2EIR>Cpi7a&`IxpH@%G6!Br5 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/refs/heads/master b/test/integration/discardStagedFiles/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index c3e34c41d..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -02f629e46dbaa03b58196cced3df07b02c0daf22 diff --git a/test/integration/discardStagedFiles/expected/repo/file0 b/test/integration/discardStagedFiles/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/discardStagedFiles/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/discardStagedFiles/expected/repo/file1 b/test/integration/discardStagedFiles/expected/repo/file1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/discardStagedFiles/expected/repo/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/discardStagedFiles/expected/repo/file2 b/test/integration/discardStagedFiles/expected/repo/file2 deleted file mode 100644 index c7c7da3c6..000000000 --- a/test/integration/discardStagedFiles/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -hello there diff --git a/test/integration/discardStagedFiles/expected/repo/file3 b/test/integration/discardStagedFiles/expected/repo/file3 deleted file mode 100644 index c7c7da3c6..000000000 --- a/test/integration/discardStagedFiles/expected/repo/file3 +++ /dev/null @@ -1 +0,0 @@ -hello there diff --git a/test/integration/discardStagedFiles/recording.json b/test/integration/discardStagedFiles/recording.json deleted file mode 100644 index 5abd7e1a8..000000000 --- a/test/integration/discardStagedFiles/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":1175,"Mod":0,"Key":256,"Ch":32},{"Timestamp":1991,"Mod":0,"Key":256,"Ch":68},{"Timestamp":2923,"Mod":0,"Key":256,"Ch":83},{"Timestamp":4453,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":213,"Height":56}]} \ No newline at end of file diff --git a/test/integration/discardStagedFiles/setup.sh b/test/integration/discardStagedFiles/setup.sh deleted file mode 100644 index caff56b7d..000000000 --- a/test/integration/discardStagedFiles/setup.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -git add . -git commit -am file1 - -echo test2 > file2 -git add . -git commit -am file2 - -echo "hello there" > file1 -echo "hello there" > file2 -echo "hello there" > file3 diff --git a/test/integration/discardStagedFiles/test.json b/test/integration/discardStagedFiles/test.json deleted file mode 100644 index 9edc4a815..000000000 --- a/test/integration/discardStagedFiles/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Discarding staged changes", "speed": 5 } From 5e9a897348945a5382025f3b2e574bf3b2e22389 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 13:35:00 +1100 Subject: [PATCH 3/5] migrate ignore gitignore integration test --- .../tests/file/exclude_gitignore.go | 39 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 ----- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 65 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 ---- .../expected/repo/.git_keep/logs/HEAD | 1 - .../repo/.git_keep/logs/refs/heads/master | 1 - .../4b/825dc642cb6eb9a060e54bf8d69288fbee4904 | Bin 15 -> 0 bytes .../e9/76bc07c8784964cf239ac9fbdc3535df55269c | Bin 123 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/lg_ignore_file | 1 - .../excludeGitIgnore/recording.json | 1 - test/integration/excludeGitIgnore/setup.sh | 15 ------- test/integration/excludeGitIgnore/test.json | 4 -- 18 files changed, 40 insertions(+), 44 deletions(-) create mode 100644 pkg/integration/tests/file/exclude_gitignore.go delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/config delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/description delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/index delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/e9/76bc07c8784964cf239ac9fbdc3535df55269c delete mode 100644 test/integration/excludeGitIgnore/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/excludeGitIgnore/expected/repo/lg_ignore_file delete mode 100644 test/integration/excludeGitIgnore/recording.json delete mode 100644 test/integration/excludeGitIgnore/setup.sh delete mode 100644 test/integration/excludeGitIgnore/test.json diff --git a/pkg/integration/tests/file/exclude_gitignore.go b/pkg/integration/tests/file/exclude_gitignore.go new file mode 100644 index 000000000..7db56d994 --- /dev/null +++ b/pkg/integration/tests/file/exclude_gitignore.go @@ -0,0 +1,39 @@ +package file + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var ExcludeGitignore = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Failed attempt at excluding and ignoring the .gitignore file", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + shell.CreateFile(".gitignore", "") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + IsFocused(). + Lines( + Contains(`?? .gitignore`).IsSelected(), + ). + Press(keys.Files.IgnoreFile). + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm() + + t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot exclude .gitignore")).Confirm() + }). + Press(keys.Files.IgnoreFile). + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm() + + t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot ignore .gitignore")).Confirm() + }) + + t.FileSystem().FileContainsContent(".gitignore", Equals("")) + t.FileSystem().FileContainsContent(".git/info/exclude", DoesNotContain(".gitignore")) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index 9278ade2b..da72f84ed 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -54,6 +54,7 @@ var tests = []*components.IntegrationTest{ file.DirWithUntrackedFile, file.DiscardChanges, file.DiscardStagedChanges, + file.ExcludeGitignore, interactive_rebase.AmendMerge, interactive_rebase.One, stash.Rename, diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 5852f4463..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/FETCH_HEAD b/test/integration/excludeGitIgnore/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD b/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/config b/test/integration/excludeGitIgnore/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/config +++ /dev/null @@ -1,10 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/description b/test/integration/excludeGitIgnore/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/index b/test/integration/excludeGitIgnore/expected/repo/.git_keep/index deleted file mode 100644 index 65d675154f23ffb2d0196e017d44a5e7017550f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmZ?q402{*U|<4bhL9jvS0E+HV4z^Y<=qr}%;|LA&IJiiy? 1657012812 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index bad114b22..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 e976bc07c8784964cf239ac9fbdc3535df55269c CI 1657012812 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a33d7621aeeaa505d30adb58afaa5559..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15 Wcmb0EGW|0ga783c@fD06pgwdlzIkCUFBILQi={l5R237%40Gd<%ZS>oCLA(R))M ze?I6Y0 .gitignore - diff --git a/test/integration/excludeGitIgnore/test.json b/test/integration/excludeGitIgnore/test.json deleted file mode 100644 index 9c466ba11..000000000 --- a/test/integration/excludeGitIgnore/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "In this test we attempt to add .gitignore to .git/info/exclude to ensure lazygit rejects the action", - "speed": 5 -} From f770a6246bfcb9de56f455eaba2880e392d0dbcf Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 14:19:56 +1100 Subject: [PATCH 4/5] rename function --- pkg/integration/components/file_system.go | 2 +- pkg/integration/tests/file/discard_staged_changes.go | 2 +- pkg/integration/tests/file/exclude_gitignore.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/integration/components/file_system.go b/pkg/integration/components/file_system.go index ea9a2e929..4ac064838 100644 --- a/pkg/integration/components/file_system.go +++ b/pkg/integration/components/file_system.go @@ -26,7 +26,7 @@ func (self *FileSystem) PathNotPresent(path string) { } // Asserts that the file at the given path has the given content -func (self *FileSystem) FileContainsContent(path string, matcher *matcher) { +func (self *FileSystem) FileContent(path string, matcher *matcher) { self.assertWithRetries(func() (bool, string) { _, err := os.Stat(path) if os.IsNotExist(err) { diff --git a/pkg/integration/tests/file/discard_staged_changes.go b/pkg/integration/tests/file/discard_staged_changes.go index 180dc45b4..728df8898 100644 --- a/pkg/integration/tests/file/discard_staged_changes.go +++ b/pkg/integration/tests/file/discard_staged_changes.go @@ -47,6 +47,6 @@ var DiscardStagedChanges = NewIntegrationTest(NewIntegrationTestArgs{ ) // the file should have the same content that it originally had, given that that was committed already - t.FileSystem().FileContainsContent("fileToRemove", Equals("original content")) + t.FileSystem().FileContent("fileToRemove", Equals("original content")) }, }) diff --git a/pkg/integration/tests/file/exclude_gitignore.go b/pkg/integration/tests/file/exclude_gitignore.go index 7db56d994..10ea62f15 100644 --- a/pkg/integration/tests/file/exclude_gitignore.go +++ b/pkg/integration/tests/file/exclude_gitignore.go @@ -33,7 +33,7 @@ var ExcludeGitignore = NewIntegrationTest(NewIntegrationTestArgs{ t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot ignore .gitignore")).Confirm() }) - t.FileSystem().FileContainsContent(".gitignore", Equals("")) - t.FileSystem().FileContainsContent(".git/info/exclude", DoesNotContain(".gitignore")) + t.FileSystem().FileContent(".gitignore", Equals("")) + t.FileSystem().FileContent(".git/info/exclude", DoesNotContain(".gitignore")) }, }) From 0300bfdec2a6c26b452c81d49a8691184498c8b6 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 15:35:12 +1100 Subject: [PATCH 5/5] update readme --- pkg/integration/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/integration/README.md b/pkg/integration/README.md index 616e09e98..889058d89 100644 --- a/pkg/integration/README.md +++ b/pkg/integration/README.md @@ -79,6 +79,8 @@ To run a test in sandbox mode you can press 's' on a test in the test TUI or in ## Migration process +You can watch how to migrate tests in this youtube [video](https://youtu.be/cJtOJu6-HcA). + At the time of writing, most tests are created under an old approach, where you would record yourself in a lazygit session and then the test would replay the keybindings with the same timestamps. This old approach is great for writing tests quickly, but is much harder to maintain. It has to rely on snapshots to determining if a test passes or fails, and can't do assertions along the way. It's also harder to grok what's the intention behind certain actions that take place within the test (e.g. was the recorder intentionally switching to another panel or was that just a misclick?). At the moment, all the deprecated test code lives in pkg/integration/deprecated. Hopefully in the very near future we migrate everything across so that we don't need to maintain two systems.