From 6cb64bd2558fa7915dc532805a06a3a24bb87855 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 19 Apr 2023 20:55:43 -0700 Subject: [PATCH] tests: drop a few unnecessary `--dry-run` from tests I think we should test actually performing the push when possible. I think I initially used `--dry-run` because I thought it wasn't possible to do local pushes with libgit2. --- tests/test_git_push.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/test_git_push.rs b/tests/test_git_push.rs index afce4fae7..22f8225be 100644 --- a/tests/test_git_push.rs +++ b/tests/test_git_push.rs @@ -111,11 +111,10 @@ fn test_git_push_parent_branch() { &["describe", "-m", "modified branch1 commit"], ); test_env.jj_cmd_success(&workspace_root, &["new"]); - let stdout = test_env.jj_cmd_success(&workspace_root, &["git", "push", "--dry-run"]); + let stdout = test_env.jj_cmd_success(&workspace_root, &["git", "push"]); insta::assert_snapshot!(stdout, @r###" Branch changes to push to origin: Force branch branch1 from 45a3aa29e907 to d47326d59ee1 - Dry-run requested, not pushing. "###); } @@ -129,7 +128,7 @@ fn test_git_no_push_parent_branch_non_empty_commit() { ); test_env.jj_cmd_success(&workspace_root, &["new"]); std::fs::write(workspace_root.join("file"), "file").unwrap(); - let stderr = test_env.jj_cmd_failure(&workspace_root, &["git", "push", "--dry-run"]); + let stderr = test_env.jj_cmd_failure(&workspace_root, &["git", "push"]); insta::assert_snapshot!(stderr, @r###" Error: No current branch. "###); @@ -144,7 +143,7 @@ fn test_git_no_push_parent_branch_description() { &["describe", "-m", "modified branch1 commit"], ); test_env.jj_cmd_success(&workspace_root, &["new", "-m", "non-empty description"]); - let stderr = test_env.jj_cmd_failure(&workspace_root, &["git", "push", "--dry-run"]); + let stderr = test_env.jj_cmd_failure(&workspace_root, &["git", "push"]); insta::assert_snapshot!(stderr, @r###" Error: No current branch. "###); @@ -411,8 +410,7 @@ fn test_git_push_deleted() { Branch changes to push to origin: Delete branch branch1 from 45a3aa29e907 "###); - let stdout = - test_env.jj_cmd_success(&workspace_root, &["git", "push", "--deleted", "--dry-run"]); + let stdout = test_env.jj_cmd_success(&workspace_root, &["git", "push", "--deleted"]); insta::assert_snapshot!(stdout, @r###" Nothing changed. "###);