lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

run integration tests with various git versions

Open Ryooooooga opened this issue 3 years ago • 4 comments

  • PR Description

https://github.com/jesseduffield/lazygit/issues/2456

although not in Docker

  • Please check if the PR fulfills these requirements
  • [x] Cheatsheets are up-to-date (run go run scripts/cheatsheet/main.go generate)
  • [x] Code has been formatted (see here)
  • [x] Tests have been added/updated (see here for the integration test guide)
  • [x] Text is internationalised (see here)
  • [x] Docs (specifically docs/Config.md) have been updated if necessary
  • [ ] You've read through your own file changes for silly mistakes etc

Ryooooooga avatar Feb 20 '23 11:02 Ryooooooga

Uffizzi Ephemeral Environment deployment-16733

:cloud: https://app.uffizzi.com/github.com/jesseduffield/lazygit/pull/2459

:page_facing_up: View Application Logs etc.

What is Uffizzi? Learn more!

github-actions[bot] avatar Feb 20 '23 11:02 github-actions[bot]

Nice work @Ryooooooga . My main hesitation here is that if a given git version fails, it might not be obvious why, and it would be good to fix it locally. If we were to use pre-built docker containers on CI, we could use the same image to be guaranteed to reproduce the issue locally. If we don't use docker, then we'll still need some way to go about reproducing locally (we could avoid docker on CI but then have some dockerfiles in the repo for local use, for example).

What are your thoughts?

jesseduffield avatar Mar 01 '23 08:03 jesseduffield

@jesseduffield I created a Docker image for local integration_test: https://github.com/Ryooooooga/lazygit/pull/4

Ryooooooga avatar Mar 01 '23 13:03 Ryooooooga

The test apply_in_reverse_with_conflict.go fails in git versions 2.30.8 and earlier. Apparently the output Applied patch to 'file2' cleanly was only added more recently. Since it is not essential that we check this output, this patch should fix it:

diff --git a/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go b/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go
index 04d160a0..ebb84fbf 100644
--- a/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go
+++ b/pkg/integration/tests/patch_building/apply_in_reverse_with_conflict.go
@@ -51,8 +51,7 @@ var ApplyInReverseWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
 
 		t.ExpectPopup().Alert().
 			Title(Equals("Error")).
-			Content(Contains("Applied patch to 'file1' with conflicts.").
-				Contains("Applied patch to 'file2' cleanly.")).
+			Content(Contains("Applied patch to 'file1' with conflicts.")).
 			Confirm()
 
 		t.Views().Files().

stefanhaller avatar Mar 18 '23 10:03 stefanhaller

@Ryooooooga Do you have time to pick this up again?

We found another regression with an older git version (#2745), and this PR would have caught it. It would be so cool to have this on master.

Let me know if you don't have time, I would consider taking it on in that case.

stefanhaller avatar Jun 27 '23 08:06 stefanhaller

Since I didn't hear back, I went ahead and made my own version of this: #2754. It uses a very similar approach as this PR, but it's also different enough that it's worth re-reviewing thoroughly.

stefanhaller avatar Jul 02 '23 20:07 stefanhaller

https://github.com/jesseduffield/lazygit/pull/2754 is approved so I'll close this off. But thanks for laying the groundwork @Ryooooooga !

jesseduffield avatar Jul 10 '23 12:07 jesseduffield