-
-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for AsyncLog respecting GIT_DIR #2387
Add test for AsyncLog respecting GIT_DIR #2387
Conversation
look how we use gitui/asyncgit/src/sync/cred.rs Line 256 in 90a2269
|
Yeah that's gonna be tough, i think the more realistic approach would be to put gitui in a lib and only start it in interactive mode when used as a bin. the lib version could allow us to provide a different rendering backend to ratatui and then we could run snapshottests against that and fully control the inputs we send to the binary |
Since there is support for snapshots in ratatui (https://ratatui.rs/recipes/testing/snapshots/), I think your approach would work well. It guess it would require a couple of changes to the app, but eventually testing would be quite straightforward. I’ll try to create a PoC once I’ve got a bit of spare time on my hand. :-) |
Awesome, thank yoU! |
@cruessler Hm did it make the CI flaky? see https://github.com/extrawurst/gitui/actions/runs/11362704155/job/31605115788 |
That’s definitely possible. I’ll have a look! Do you happen to know whether |
@cruessler i don’t think it’s about the file it’s about making sure any test that this can interfere with needs to have that annotation |
Does it make sense to run this test as part of a different test suite in its own process? Something like a separate invocation of |
the problem is that we do not even know what the result is. we should unwrap so that we can see exactly what failed. i will roll this PR back, can you open a new PR then that redoes it but unwraps the result at the end so we can see what is going wrong? |
This reverts commit 9c433b4.
@cruessler its reverted |
@extrawurst I created a follow-up PR: #2409. |
This is a follow-up to #2301. It adds a test for
AsyncLog::fetch_helper_without_filter
respectingGIT_DIR
. The docs tostd::env::set_var
say that it is only safe to be used in single-threaded programs. Could this ever become an issue? On my machine,make check
was green.(Creating snapshot tests running the
gitui
binary has proven to be rather challenging. So far, I have not found a crate that would work withenable_raw_mode
which is why I decided to open this PR.)