diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-13 17:18:35 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-13 22:08:56 +0000 |
| commit | 82c7a95f6e9aa266d2f0d2035a0ce4f1715b62ad (patch) | |
| tree | 9de47f91a6157f9361b2bf28618d89873a55227a /tests/git_remote_nostr/push.rs | |
| parent | ebab8d2aa487d1814e802c5a51b19d4bb1592e01 (diff) | |
feat(list): make list async and include sync report inline
copy relay fetching approach to async and reporting
Diffstat (limited to 'tests/git_remote_nostr/push.rs')
| -rw-r--r-- | tests/git_remote_nostr/push.rs | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/git_remote_nostr/push.rs b/tests/git_remote_nostr/push.rs index 647a2f3..404d07f 100644 --- a/tests/git_remote_nostr/push.rs +++ b/tests/git_remote_nostr/push.rs | |||
| @@ -845,7 +845,7 @@ async fn pushes_to_all_git_servers_listed_and_ok_printed() -> Result<()> { | |||
| 845 | async fn proposal_three_way_merge_commit_pushed_to_main_leads_to_status_event_issued() -> Result<()> | 845 | async fn proposal_three_way_merge_commit_pushed_to_main_leads_to_status_event_issued() -> Result<()> |
| 846 | { | 846 | { |
| 847 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 847 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 848 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 848 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 849 | 849 | ||
| 850 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 850 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 851 | Relay::new(8051, None, None), | 851 | Relay::new(8051, None, None), |
| @@ -881,8 +881,7 @@ async fn proposal_three_way_merge_commit_pushed_to_main_leads_to_status_event_is | |||
| 881 | 881 | ||
| 882 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 882 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 883 | cli_expect_nostr_fetch(&mut p)?; | 883 | cli_expect_nostr_fetch(&mut p)?; |
| 884 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 884 | p.expect("git servers: listing refs...\r\n")?; |
| 885 | p.expect("list: connecting...\r\n")?; | ||
| 886 | p.expect_eventually("merge commit ")?; | 885 | p.expect_eventually("merge commit ")?; |
| 887 | // shorthand merge commit id appears in this gap | 886 | // shorthand merge commit id appears in this gap |
| 888 | p.expect_eventually(": create nostr proposal status event\r\n")?; | 887 | p.expect_eventually(": create nostr proposal status event\r\n")?; |
| @@ -1002,7 +1001,7 @@ async fn proposal_fast_forward_merge_commits_pushed_to_main_leads_to_status_even | |||
| 1002 | -> Result<()> { | 1001 | -> Result<()> { |
| 1003 | // | 1002 | // |
| 1004 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 1003 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 1005 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 1004 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 1006 | 1005 | ||
| 1007 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 1006 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 1008 | Relay::new(8051, None, None), | 1007 | Relay::new(8051, None, None), |
| @@ -1035,8 +1034,7 @@ async fn proposal_fast_forward_merge_commits_pushed_to_main_leads_to_status_even | |||
| 1035 | 1034 | ||
| 1036 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1035 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1037 | cli_expect_nostr_fetch(&mut p)?; | 1036 | cli_expect_nostr_fetch(&mut p)?; |
| 1038 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 1037 | p.expect("git servers: listing refs...\r\n")?; |
| 1039 | p.expect("list: connecting...\r\n")?; | ||
| 1040 | p.expect_eventually(format!( | 1038 | p.expect_eventually(format!( |
| 1041 | "fast-forward merge: create nostr proposal status event for {branch_name}\r\n" | 1039 | "fast-forward merge: create nostr proposal status event for {branch_name}\r\n" |
| 1042 | ))?; | 1040 | ))?; |
| @@ -1184,7 +1182,7 @@ async fn proposal_fast_forward_merge_commits_pushed_to_main_leads_to_status_even | |||
| 1184 | async fn proposal_commits_applied_and_pushed_to_main_leads_to_status_event_issued() -> Result<()> { | 1182 | async fn proposal_commits_applied_and_pushed_to_main_leads_to_status_event_issued() -> Result<()> { |
| 1185 | // | 1183 | // |
| 1186 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 1184 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 1187 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 1185 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 1188 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 1186 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 1189 | Relay::new(8051, None, None), | 1187 | Relay::new(8051, None, None), |
| 1190 | Relay::new(8052, None, None), | 1188 | Relay::new(8052, None, None), |
| @@ -1222,8 +1220,7 @@ async fn proposal_commits_applied_and_pushed_to_main_leads_to_status_event_issue | |||
| 1222 | 1220 | ||
| 1223 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1221 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1224 | cli_expect_nostr_fetch(&mut p)?; | 1222 | cli_expect_nostr_fetch(&mut p)?; |
| 1225 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 1223 | p.expect("git servers: listing refs...\r\n")?; |
| 1226 | p.expect("list: connecting...\r\n")?; | ||
| 1227 | p.expect_eventually(format!( | 1224 | p.expect_eventually(format!( |
| 1228 | "applied commits from proposal: create nostr proposal status event for {branch_name}\r\n" ))?; | 1225 | "applied commits from proposal: create nostr proposal status event for {branch_name}\r\n" ))?; |
| 1229 | // status updates printed here | 1226 | // status updates printed here |
| @@ -1354,7 +1351,7 @@ async fn proposal_commits_applied_and_pushed_to_main_leads_to_status_event_issue | |||
| 1354 | #[serial] | 1351 | #[serial] |
| 1355 | async fn push_2_commits_to_existing_proposal() -> Result<()> { | 1352 | async fn push_2_commits_to_existing_proposal() -> Result<()> { |
| 1356 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 1353 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 1357 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 1354 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 1358 | 1355 | ||
| 1359 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 1356 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 1360 | Relay::new(8051, None, None), | 1357 | Relay::new(8051, None, None), |
| @@ -1384,8 +1381,7 @@ async fn push_2_commits_to_existing_proposal() -> Result<()> { | |||
| 1384 | 1381 | ||
| 1385 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1382 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1386 | cli_expect_nostr_fetch(&mut p)?; | 1383 | cli_expect_nostr_fetch(&mut p)?; |
| 1387 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 1384 | p.expect("git servers: listing refs...\r\n")?; |
| 1388 | p.expect("list: connecting...\r\n\r")?; | ||
| 1389 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1385 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1390 | let output = p.expect_end_eventually()?; | 1386 | let output = p.expect_end_eventually()?; |
| 1391 | 1387 | ||
| @@ -1500,7 +1496,7 @@ async fn push_2_commits_to_existing_proposal() -> Result<()> { | |||
| 1500 | #[serial] | 1496 | #[serial] |
| 1501 | async fn force_push_creates_proposal_revision() -> Result<()> { | 1497 | async fn force_push_creates_proposal_revision() -> Result<()> { |
| 1502 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 1498 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 1503 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 1499 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 1504 | 1500 | ||
| 1505 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 1501 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 1506 | Relay::new(8051, None, None), | 1502 | Relay::new(8051, None, None), |
| @@ -1539,8 +1535,7 @@ async fn force_push_creates_proposal_revision() -> Result<()> { | |||
| 1539 | let mut p = | 1535 | let mut p = |
| 1540 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); | 1536 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); |
| 1541 | cli_expect_nostr_fetch(&mut p)?; | 1537 | cli_expect_nostr_fetch(&mut p)?; |
| 1542 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 1538 | p.expect("git servers: listing refs...\r\n")?; |
| 1543 | p.expect("list: connecting...\r\n")?; | ||
| 1544 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1539 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1545 | let output = p.expect_end_eventually()?; | 1540 | let output = p.expect_end_eventually()?; |
| 1546 | 1541 | ||
| @@ -1659,7 +1654,7 @@ async fn force_push_creates_proposal_revision() -> Result<()> { | |||
| 1659 | #[serial] | 1654 | #[serial] |
| 1660 | async fn push_new_pr_branch_creates_proposal() -> Result<()> { | 1655 | async fn push_new_pr_branch_creates_proposal() -> Result<()> { |
| 1661 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; | 1656 | let (events, source_git_repo) = prep_source_repo_and_events_including_proposals().await?; |
| 1662 | let source_path = source_git_repo.dir.to_str().unwrap().to_string(); | 1657 | let _source_path = source_git_repo.dir.to_str().unwrap().to_string(); |
| 1663 | 1658 | ||
| 1664 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( | 1659 | let (mut r51, mut r52, mut r53, mut r55, mut r56, mut r57) = ( |
| 1665 | Relay::new(8051, None, None), | 1660 | Relay::new(8051, None, None), |
| @@ -1693,8 +1688,7 @@ async fn push_new_pr_branch_creates_proposal() -> Result<()> { | |||
| 1693 | ["push", "-u", "origin", branch_name], | 1688 | ["push", "-u", "origin", branch_name], |
| 1694 | ); | 1689 | ); |
| 1695 | cli_expect_nostr_fetch(&mut p)?; | 1690 | cli_expect_nostr_fetch(&mut p)?; |
| 1696 | p.expect(format!("fetching {source_path} ref list over filesystem...\r\n").as_str())?; | 1691 | p.expect("git servers: listing refs...\r\n")?; |
| 1697 | p.expect("list: connecting...\r\n\r")?; | ||
| 1698 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1692 | p.expect_eventually_and_print(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1699 | let output = p.expect_end_eventually()?; | 1693 | let output = p.expect_end_eventually()?; |
| 1700 | 1694 | ||