From e75e6fa2a10ff134b4a8806451cde0d784cc3212 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 3 Apr 2023 15:11:55 -0700 Subject: [PATCH] test_git_colocated.rs: Adding another push to squash-push-undo test breaks it This change should not affect the test at all, but does. --- tests/test_git_colocated.rs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/test_git_colocated.rs b/tests/test_git_colocated.rs index a5dfa3ed32..aeda3503d9 100644 --- a/tests/test_git_colocated.rs +++ b/tests/test_git_colocated.rs @@ -297,7 +297,11 @@ fn test_git_colocated_squash_undo() { "###); } -// This test is just like the above test but with a `jj git push` inserted +// This test is just like the above test but with a couple of `jj git push` +// inserted +// +// TODO: Fix the BUG it reveals. The bug may be related to `jj git push` not +// calling `jj git export` properly, or it may be a bug in `jj git export. #[test] fn test_git_colocated_squash_push_undo() { let test_env = TestEnvironment::default(); @@ -309,6 +313,7 @@ fn test_git_colocated_squash_push_undo() { test_env.jj_cmd_success(&repo_path, &["ci", "-m=A"]); test_env.jj_cmd_success(&repo_path, &["describe", "-m=B"]); test_env.jj_cmd_success(&repo_path, &["branch", "set", "master"]); + test_env.jj_cmd_success(&repo_path, &["git", "push", "--all"]); // Test the setup insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" @ rlvkpnrzqnoo 2a3078eda7fe B master @@ -318,35 +323,34 @@ fn test_git_colocated_squash_push_undo() { test_env.jj_cmd_success(&repo_path, &["squash", "-m=A+B"]); insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" - @ royxmykxtrkr 83c0d8df2b78 - ◉ qpvuntsmwlqt 1873a0811bf5 A+B master + @ yqosqzytrlsw 91096ede1b94 + ◉ qpvuntsmwlqt 3ca5eff09136 A+B master* ◉ zzzzzzzzzzzz 000000000000 "###); test_env.jj_cmd_success(&repo_path, &["git", "push", "--all"]); insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" - @ royxmykxtrkr 83c0d8df2b78 - ◉ qpvuntsmwlqt 1873a0811bf5 A+B master + @ yqosqzytrlsw 91096ede1b94 + ◉ qpvuntsmwlqt 3ca5eff09136 A+B master ◉ zzzzzzzzzzzz 000000000000 "###); let stdout = get_truncated_op_log(&test_env, &repo_path, 9); insta::assert_snapshot!(stdout, @r###" - @ 92f3965076e7 test-username@host.example.com 22 years ago, lasted less than a microsecond + @ e3ba083e16da test-username@host.example.com 22 years ago, lasted less than a microsecond │ push all branches to git remote origin │ args: jj git push --all - ◉ 34f35f48e4eb test-username@host.example.com 22 years ago, lasted less than a microsecond + ◉ 98b717fda32d test-username@host.example.com 22 years ago, lasted less than a microsecond │ squash commit 2a3078eda7fe17eeb3cd3e390f7476dff078e35f │ args: jj squash '-m=A+B' - ◉ dfdfe3eb8a2c test-username@host.example.com 22 years ago, lasted less than a microsecond - │ point branch master to commit 2a3078eda7fe17eeb3cd3e390f7476dff078e35f - │ args: jj branch set master + ◉ 05b9c30f160f test-username@host.example.com 22 years ago, lasted less than a microsecond + │ push all branches to git remote origin + │ args: jj git push --all "###); // Restore to before the squash test_env.jj_cmd_success(&repo_path, &["op", "restore", "@--"]); - // We expect `master` to be back at B while master@origin is at A+B. Here, - // master ends up conflicted. This is arguably wrong, but not too bad. + // BUG: `master` didn't get back to B insta::assert_snapshot!(get_log_output_divergence(&test_env, &repo_path), @r###" - ◉ qpvuntsmwlqt 1873a0811bf5 A+B master?? master@origin !divergence! - │ @ rlvkpnrzqnoo 2a3078eda7fe B master?? + ◉ qpvuntsmwlqt 3ca5eff09136 A+B master !divergence! + │ @ rlvkpnrzqnoo 2a3078eda7fe B │ ◉ qpvuntsmwlqt a86754f975f9 A !divergence! ├─╯ ◉ zzzzzzzzzzzz 000000000000