diff options
Diffstat (limited to 'tests/git_remote_nostr/push.rs')
| -rw-r--r-- | tests/git_remote_nostr/push.rs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/tests/git_remote_nostr/push.rs b/tests/git_remote_nostr/push.rs index 5066d33..7b6ab28 100644 --- a/tests/git_remote_nostr/push.rs +++ b/tests/git_remote_nostr/push.rs | |||
| @@ -54,7 +54,7 @@ mod two_branches_in_batch_one_added_one_updated { | |||
| 54 | p.send_line("push refs/heads/main:refs/heads/main")?; | 54 | p.send_line("push refs/heads/main:refs/heads/main")?; |
| 55 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; | 55 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; |
| 56 | p.send_line("")?; | 56 | p.send_line("")?; |
| 57 | p.expect_eventually("\r\n\r\n")?; | 57 | p.expect_eventually("\r\n\r\r\n")?; |
| 58 | p.exit()?; | 58 | p.exit()?; |
| 59 | for p in [51, 52, 53, 55, 56, 57] { | 59 | for p in [51, 52, 53, 55, 56, 57] { |
| 60 | relay::shutdown_relay(8000 + p)?; | 60 | relay::shutdown_relay(8000 + p)?; |
| @@ -128,7 +128,7 @@ mod two_branches_in_batch_one_added_one_updated { | |||
| 128 | p.send_line("push refs/heads/main:refs/heads/main")?; | 128 | p.send_line("push refs/heads/main:refs/heads/main")?; |
| 129 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; | 129 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; |
| 130 | p.send_line("")?; | 130 | p.send_line("")?; |
| 131 | p.expect_eventually("\r\n\r\n")?; | 131 | p.expect_eventually("\r\n\r\r\n")?; |
| 132 | p.exit()?; | 132 | p.exit()?; |
| 133 | for p in [51, 52, 53, 55, 56, 57] { | 133 | for p in [51, 52, 53, 55, 56, 57] { |
| 134 | relay::shutdown_relay(8000 + p)?; | 134 | relay::shutdown_relay(8000 + p)?; |
| @@ -217,7 +217,7 @@ mod two_branches_in_batch_one_added_one_updated { | |||
| 217 | p.send_line("")?; | 217 | p.send_line("")?; |
| 218 | p.expect("ok refs/heads/main\r\n")?; | 218 | p.expect("ok refs/heads/main\r\n")?; |
| 219 | p.expect("ok refs/heads/vnext\r\n")?; | 219 | p.expect("ok refs/heads/vnext\r\n")?; |
| 220 | p.expect("\r\n")?; | 220 | p.expect_eventually("\r\n\r\r\n")?; |
| 221 | p.exit()?; | 221 | p.exit()?; |
| 222 | for p in [51, 52, 53, 55, 56, 57] { | 222 | for p in [51, 52, 53, 55, 56, 57] { |
| 223 | relay::shutdown_relay(8000 + p)?; | 223 | relay::shutdown_relay(8000 + p)?; |
| @@ -276,7 +276,7 @@ mod two_branches_in_batch_one_added_one_updated { | |||
| 276 | p.send_line("push refs/heads/main:refs/heads/main")?; | 276 | p.send_line("push refs/heads/main:refs/heads/main")?; |
| 277 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; | 277 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; |
| 278 | p.send_line("")?; | 278 | p.send_line("")?; |
| 279 | p.expect_eventually_and_print("\r\n\r\n")?; | 279 | p.expect_eventually_and_print("\r\n\r\r\n")?; |
| 280 | p.exit()?; | 280 | p.exit()?; |
| 281 | for p in [51, 52, 53, 55, 56, 57] { | 281 | for p in [51, 52, 53, 55, 56, 57] { |
| 282 | relay::shutdown_relay(8000 + p)?; | 282 | relay::shutdown_relay(8000 + p)?; |
| @@ -362,7 +362,7 @@ mod two_branches_in_batch_one_added_one_updated { | |||
| 362 | p.send_line("push refs/heads/main:refs/heads/main")?; | 362 | p.send_line("push refs/heads/main:refs/heads/main")?; |
| 363 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; | 363 | p.send_line("push refs/heads/vnext:refs/heads/vnext")?; |
| 364 | p.send_line("")?; | 364 | p.send_line("")?; |
| 365 | p.expect_eventually_and_print("\r\n\r\n")?; | 365 | p.expect_eventually_and_print("\r\n\r\r\n")?; |
| 366 | p.exit()?; | 366 | p.exit()?; |
| 367 | for p in [51, 52, 53, 55, 56, 57] { | 367 | for p in [51, 52, 53, 55, 56, 57] { |
| 368 | relay::shutdown_relay(8000 + p)?; | 368 | relay::shutdown_relay(8000 + p)?; |
| @@ -486,7 +486,7 @@ mod delete_one_branch { | |||
| 486 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; | 486 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; |
| 487 | p.send_line("push :refs/heads/vnext")?; | 487 | p.send_line("push :refs/heads/vnext")?; |
| 488 | p.send_line("")?; | 488 | p.send_line("")?; |
| 489 | p.expect_eventually_and_print("\r\n\r\n")?; | 489 | p.expect_eventually_and_print("\r\n\r\r\n")?; |
| 490 | p.exit()?; | 490 | p.exit()?; |
| 491 | for p in [51, 52, 53, 55, 56, 57] { | 491 | for p in [51, 52, 53, 55, 56, 57] { |
| 492 | relay::shutdown_relay(8000 + p)?; | 492 | relay::shutdown_relay(8000 + p)?; |
| @@ -561,7 +561,7 @@ mod delete_one_branch { | |||
| 561 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; | 561 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; |
| 562 | p.send_line("push :refs/heads/vnext")?; | 562 | p.send_line("push :refs/heads/vnext")?; |
| 563 | p.send_line("")?; | 563 | p.send_line("")?; |
| 564 | p.expect_eventually("\r\n\r\n")?; | 564 | p.expect_eventually("\r\n\r\r\n")?; |
| 565 | p.exit()?; | 565 | p.exit()?; |
| 566 | for p in [51, 52, 53, 55, 56, 57] { | 566 | for p in [51, 52, 53, 55, 56, 57] { |
| 567 | relay::shutdown_relay(8000 + p)?; | 567 | relay::shutdown_relay(8000 + p)?; |
| @@ -626,10 +626,8 @@ mod delete_one_branch { | |||
| 626 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; | 626 | let mut p = cli_tester_after_nostr_fetch_and_sent_list_for_push_responds(&git_repo)?; |
| 627 | p.send_line("push :refs/heads/vnext")?; | 627 | p.send_line("push :refs/heads/vnext")?; |
| 628 | p.send_line("")?; | 628 | p.send_line("")?; |
| 629 | // let res = p.expect_eventually("\r\n\r\n")?; | ||
| 630 | // println!("{res}"); | ||
| 631 | p.expect("ok refs/heads/vnext\r\n")?; | 629 | p.expect("ok refs/heads/vnext\r\n")?; |
| 632 | p.expect("\r\n")?; | 630 | p.expect_eventually("\r\n\r\r\n")?; |
| 633 | p.exit()?; | 631 | p.exit()?; |
| 634 | for p in [51, 52, 53, 55, 56, 57] { | 632 | for p in [51, 52, 53, 55, 56, 57] { |
| 635 | relay::shutdown_relay(8000 + p)?; | 633 | relay::shutdown_relay(8000 + p)?; |
| @@ -687,7 +685,7 @@ mod delete_one_branch { | |||
| 687 | p.send_line("push :refs/heads/example-branch")?; | 685 | p.send_line("push :refs/heads/example-branch")?; |
| 688 | p.send_line("")?; | 686 | p.send_line("")?; |
| 689 | p.expect("ok refs/heads/example-branch\r\n")?; | 687 | p.expect("ok refs/heads/example-branch\r\n")?; |
| 690 | p.expect("\r\n")?; | 688 | p.expect_eventually("\r\n\r\r\n")?; |
| 691 | p.exit()?; | 689 | p.exit()?; |
| 692 | for p in [51, 52, 53, 55, 56, 57] { | 690 | for p in [51, 52, 53, 55, 56, 57] { |
| 693 | relay::shutdown_relay(8000 + p)?; | 691 | relay::shutdown_relay(8000 + p)?; |
| @@ -773,7 +771,7 @@ mod delete_one_branch { | |||
| 773 | p.send_line("push :refs/heads/example-branch")?; | 771 | p.send_line("push :refs/heads/example-branch")?; |
| 774 | p.send_line("")?; | 772 | p.send_line("")?; |
| 775 | p.expect("ok refs/heads/example-branch\r\n")?; | 773 | p.expect("ok refs/heads/example-branch\r\n")?; |
| 776 | p.expect("\r\n")?; | 774 | p.expect_eventually("\r\n")?; |
| 777 | p.exit()?; | 775 | p.exit()?; |
| 778 | for p in [51, 52, 53, 55, 56, 57] { | 776 | for p in [51, 52, 53, 55, 56, 57] { |
| 779 | relay::shutdown_relay(8000 + p)?; | 777 | relay::shutdown_relay(8000 + p)?; |
| @@ -857,7 +855,7 @@ async fn pushes_to_all_git_servers_listed_and_ok_printed() -> Result<()> { | |||
| 857 | p.send_line("push refs/heads/main:refs/heads/main")?; | 855 | p.send_line("push refs/heads/main:refs/heads/main")?; |
| 858 | p.send_line("")?; | 856 | p.send_line("")?; |
| 859 | p.expect("ok refs/heads/main\r\n")?; | 857 | p.expect("ok refs/heads/main\r\n")?; |
| 860 | p.expect("\r\n")?; | 858 | p.expect_eventually("\r\n\r\r\n")?; |
| 861 | p.exit()?; | 859 | p.exit()?; |
| 862 | for p in [51, 52, 53, 55, 56, 57] { | 860 | for p in [51, 52, 53, 55, 56, 57] { |
| 863 | relay::shutdown_relay(8000 + p)?; | 861 | relay::shutdown_relay(8000 + p)?; |
| @@ -931,11 +929,12 @@ async fn proposal_merge_commit_pushed_to_main_leads_to_status_event_issued() -> | |||
| 931 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 929 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 932 | cli_expect_nostr_fetch(&mut p)?; | 930 | cli_expect_nostr_fetch(&mut p)?; |
| 933 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; | 931 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; |
| 934 | 932 | p.expect("list: connecting...\r\n")?; | |
| 935 | p.expect("merge commit ")?; | 933 | p.expect_after_whitespace("merge commit ")?; |
| 936 | // shorthand merge commit id appears in this gap | 934 | // shorthand merge commit id appears in this gap |
| 937 | p.expect_eventually(": create nostr proposal status event\r\n")?; | 935 | p.expect_eventually(": create nostr proposal status event\r\n")?; |
| 938 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 936 | // status updates printed here |
| 937 | p.expect_eventually(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | ||
| 939 | let output = p.expect_end_eventually()?; | 938 | let output = p.expect_end_eventually()?; |
| 940 | 939 | ||
| 941 | for p in [51, 52, 53, 55, 56, 57] { | 940 | for p in [51, 52, 53, 55, 56, 57] { |
| @@ -1075,6 +1074,7 @@ async fn push_2_commits_to_existing_proposal() -> Result<()> { | |||
| 1075 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1074 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1076 | cli_expect_nostr_fetch(&mut p)?; | 1075 | cli_expect_nostr_fetch(&mut p)?; |
| 1077 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; | 1076 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; |
| 1077 | p.expect("list: connecting...\r\n\r\r\r")?; | ||
| 1078 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1078 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1079 | let output = p.expect_end_eventually()?; | 1079 | let output = p.expect_end_eventually()?; |
| 1080 | 1080 | ||
| @@ -1229,7 +1229,8 @@ async fn force_push_creates_proposal_revision() -> Result<()> { | |||
| 1229 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); | 1229 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); |
| 1230 | cli_expect_nostr_fetch(&mut p)?; | 1230 | cli_expect_nostr_fetch(&mut p)?; |
| 1231 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; | 1231 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; |
| 1232 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1232 | p.expect("list: connecting...\r\n")?; |
| 1233 | p.expect_after_whitespace(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | ||
| 1233 | let output = p.expect_end_eventually()?; | 1234 | let output = p.expect_end_eventually()?; |
| 1234 | 1235 | ||
| 1235 | for p in [51, 52, 53, 55, 56, 57] { | 1236 | for p in [51, 52, 53, 55, 56, 57] { |
| @@ -1378,6 +1379,7 @@ async fn push_new_pr_branch_creates_proposal() -> Result<()> { | |||
| 1378 | ); | 1379 | ); |
| 1379 | cli_expect_nostr_fetch(&mut p)?; | 1380 | cli_expect_nostr_fetch(&mut p)?; |
| 1380 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; | 1381 | p.expect(format!("fetching {} ref list over filesystem...\r\n", source_path).as_str())?; |
| 1382 | p.expect("list: connecting...\r\n\r\r\r")?; | ||
| 1381 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1383 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1382 | let output = p.expect_end_eventually()?; | 1384 | let output = p.expect_end_eventually()?; |
| 1383 | 1385 | ||