1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
Commit Graph

58 Commits

Author SHA1 Message Date
8c716184c1 Set working directory in lazygit test command
We need to fetch our list of tests both outside of our test binary and within. We need
to get the list from within so that we can run the code that drives the test and runs
assertions. To get the list of tests we need to know where the root of the lazygit repo
is, given that the tests live in files under that root.

So far, we've used this GetLazyRootDirectory() function for that, but it assumes that
we're not in a test directory (it just looks for the first .git dir it can find). Because
we didn't want to properly fix this before, we've been setting the working directory of
the test command to the lazygit root, and using the --path CLI arg to override it when
the test itself ran. This was a terrible hack.

Now, we're passing the lazygit root directory as an env var to the integration test, so
that we can set the working directory to the actual path of the test repo; removing the
need to use the --path arg.
2024-01-12 19:59:31 +11:00
e33fe37a99 Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one
for consistency. Lo is more extensive and better maintained so we're going with that.

My slices package was a superset of go's own slices package so in some places I've just used
the official one (the methods were just wrappers anyway).

I've also moved the remaining methods into the utils package.
2023-07-30 18:51:23 +10:00
f7e8b2dd71 cleanup integration test code 2023-02-26 12:54:13 +11:00
f999bbce7c add code generator for creating tests list 2023-02-19 11:48:09 +11:00
stk
97daec7228 Add test demonstrating selection bug when staging a range of lines
The selected line is not in the right position after staging a range of lines;
see next commit.
2023-02-15 21:28:05 +01:00
31fcec16d9 Merge pull request #2429 from stefanhaller/do-not-autosquash-in-regular-rebase 2023-02-15 20:21:08 +11:00
3cfdae4116 migrate submodule reset test 2023-02-12 18:12:01 +11:00
d7956c481d migrate submodule enter test 2023-02-12 18:12:01 +11:00
1c48842277 migrate submodule remove test 2023-02-12 10:47:45 +11:00
010f6d7f6e migrate submodule add test 2023-02-12 10:47:41 +11:00
stk
e357c00d4d Add an integration test showing a problem with autosquash during normal rebase
For users who have the rebase.autoSquash git config set to true, any regular
rebase will squash fixups in addition to rebasing. Not good -- we'll fix that in
the next commit.
2023-02-09 17:35:20 +01:00
stk
e57843d947 Add integration test for ignoring whitespace in diff 2023-02-07 13:33:10 +01:00
368d6437b8 Merge pull request #2373 from phanithinks/clipboard_patch_option_2357 2023-01-31 17:02:46 +11:00
5dec080719 fix: fix RefName of detached HEAD to works in Chinese 2023-01-27 20:45:18 +09:00
d479a41cad Added Integration testing the copy to clipboard in patchbuilding 2023-01-18 21:05:40 +05:30
89ba3a38b4 migrate filter path tests 2022-12-30 22:42:32 +11:00
6f709456fe migrate test for rename branch and pull 2022-12-30 22:42:32 +11:00
277ca706eb migrate fetchPrune integration test 2022-12-30 22:42:32 +11:00
8a1c763942 more git ignore stuff in integration test 2022-12-30 22:42:32 +11:00
5e9a897348 migrate ignore gitignore integration test 2022-12-28 13:35:07 +11:00
f2d0f362d4 migrate discard staged changes test 2022-12-28 13:24:23 +11:00
ae07cf5506 migrate discard old file change test 2022-12-28 13:01:32 +11:00
b623ecf898 add helper functions for popups in tests 2022-12-24 19:15:59 +11:00
5c11b1ecb7 discard changes integration test 2022-12-24 19:05:46 +11:00
7c7f7bf9b9 migrate diffing integration tests 2022-12-21 22:52:23 +11:00
f910b42c9c migrate confirm-on-quit integration test 2022-12-20 23:08:39 +11:00
bc4ace8357 add commit revert integration test 2022-12-20 22:45:02 +11:00
b40190bd94 add multi-line commit integration test 2022-12-20 22:45:02 +11:00
b13cfdfea0 migrate branch reset integration test 2022-12-19 22:38:32 +11:00
50b0d85cd3 integration tests for commit without pre-commit hooks in staging files menu 2022-12-01 09:12:18 +11:00
87e0f6b92d integration tests for commit in staged files and unstaged files menus 2022-12-01 09:12:18 +11:00
b3d086bdc1 Resolve the prompt just before using it
In case a later command depends on a prompt input from a previous one we
need to evaluate it only after the previous prompt has been confirmed.
2022-11-25 22:46:36 +01:00
245563bc99 (#2288) quote remoteName before compiling regex
If the remote name contains special regex-chars,
the compilation of the regex might fail.
Quoting the remoteName ensures that all special chars
in the remoteName are properly escaped before compiling
the regex.
2022-11-24 12:56:28 +00:00
52a2e4c1dc fix: fix ambiguous branch name
test: add an integration test for checkout branch by name

fix: fix full ref name of detached head

refactor: refactor current branch loader

chore: use field name explicitly
2022-11-14 19:05:07 +11:00
9e91aa8b43 fix: delete duplicate import 2022-11-12 18:11:34 -03:30
7977c2deb5 fix: delete duplicate line 2022-11-12 18:10:34 -03:30
d7fb441a3c refactor: sort list of integration tests 2022-11-12 18:09:55 -03:30
97ced9e14f fix could-not-access error 2022-11-12 18:09:15 -03:30
a47e72892a Merge branch 'master' into stash-untracked-changes 2022-11-01 16:08:34 -02:30
e78e829e3a test: add an integration test for rename stash 2022-10-16 09:30:03 +09:00
39e84e13f4 Use lazycore utils: Clamp and GetLazyRootDirectory 2022-10-15 13:55:44 -03:00
8c46a0110d Merge branch 'master' into stash-untracked-changes 2022-10-06 22:59:06 -02:30
a30d924afe test: add test for stash including untracked files 2022-10-06 22:53:13 -02:30
0141bbde0e Add test for amending a merge commit 2022-09-24 23:37:17 +02:00
7e9dffe1b9 Add Key field to CustomCommandPrompt struct
Add Form field to CustomCommandObjects struct

Write user prompts responses to Form field

Ensure that map keys exists

Add form prompts integration test

Remove redundant index
2022-09-17 14:58:44 -07:00
74acb3e86a add integration tests for cherry picking 2022-09-16 22:15:16 -07:00
db9373662a test: add test for basic stash 2022-09-15 23:11:27 -02:30
7b757d1cfe add branch rebase integration test 2022-09-09 20:55:47 -07:00
843488bff4 add branch delete integration test 2022-09-09 20:55:47 -07:00
8cdfc6758f add another bisect integration test 2022-09-09 20:55:47 -07:00