-
Notifications
You must be signed in to change notification settings - Fork 596
cli/tests: move a lot of the cli tests to gitoxide
#5575
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
Conversation
57ad301
to
230f526
Compare
523dc68
to
a4632fe
Compare
Managed to port another test ( |
93d73fe
to
c9d7d11
Compare
Ported |
c9d7d11
to
a56c843
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the first two patches.
I wouldn't make this PR grow indefinitely because GitHub doesn't support per-patch approval.
0ffe93a
to
ac5aabf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commits up to "cli/tests: port test_git_init to gitoxide" look good, thanks.
@@ -145,7 +120,6 @@ fn test_git_colocated_unborn_bookmark() { | |||
◆ 0000000000000000000000000000000000000000 | |||
"###); | |||
// Staged change shouldn't persist. | |||
checkout_index(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to either check out the index content to working copy or assert the index contents to ensure that the Git index is reset by jj new root()
.
let git_repo = init_git_repo(&workspace_root, false); | ||
git_repo.config().unwrap().remove("core.bare").unwrap(); | ||
let _git_repo = init_git_repo(&workspace_root, false); | ||
//git_repo.config().unwrap().remove("core.bare").unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you insert a snapshot of .git/config
to ensure that core.bare
key doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is don
The `mod.rs` was becoming crowded and this makes way for unrelated additions to the test utilities module
a19ec73
to
ddc9f55
Compare
ddc9f55
to
fc2a52b
Compare
cargo-insta was re-run. This is due to centralizing git interaction code to use a particular different signature, which changes the commit hashes
cargo-insta was re-run. This is due to centralizing git interaction code to use a particular different signature, which changes the commit hashes
cargo-insta was re-run. This is due to centralizing git interaction code to use a particular different signature, which changes the commit hashes
cargo-insta was re-run. This is due to centralizing git interaction code to use a particular different signature, which changes the commit hashes
fc2a52b
to
0a97779
Compare
In keeping with #5548 , this moves a lot of the current
cli
tests to gitoxide.This doesn't do it all. but thought it best to send this as is, as there is a lot of code to review already (even though most of it is relatively straightforward). Nevertheless, this is what is missing:
push/fetch/clone/remote
require adding git remotes, which is not easy. Maybe when git: port remote management togix
#5553 is merged we can use that machinery directly heretest_git_colocated
: i have it mostly done locally, but not quitetest_git_init
: dittoThis PR also consolidates a lot of what was copy pasted code (namely creating new repos and adding commits to it). This, plus gitoxide's idiosyncrasies make most of the git hashes in the tests change, hence
cargo-insta
was run in a separate commit to avoid the noise.The new
gitoxide
helpers incli/tests/common/gitoxide.rs
help centralize a lot of common functionality, and make sure we don't run into GitoxideLabs/gitoxide#1829.Overall, this PR has a lot of commits to help reviewing, but at the end of the day, I think the commit structure should be: