diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-06 13:07:29 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-06 14:06:03 +0100 |
| commit | ad28bd8db1a6e953dce999eea85becda1d90beae (patch) | |
| tree | fbd5241102bb1a06f6157afe0cd3781f46db2b27 /tests/git_remote_helper.rs | |
| parent | 0b9ebd63be13ee403c415d4a29538b94f9e7cffe (diff) | |
fix(remote): `fetch` and `list` status copy
so that it the filesystem url is shown
Diffstat (limited to 'tests/git_remote_helper.rs')
| -rw-r--r-- | tests/git_remote_helper.rs | 73 |
1 files changed, 61 insertions, 12 deletions
diff --git a/tests/git_remote_helper.rs b/tests/git_remote_helper.rs index 07f9ec8..7251204 100644 --- a/tests/git_remote_helper.rs +++ b/tests/git_remote_helper.rs | |||
| @@ -314,7 +314,13 @@ mod list { | |||
| 314 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 314 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 315 | let mut p = cli_tester_after_fetch(&git_repo)?; | 315 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 316 | p.send_line("list")?; | 316 | p.send_line("list")?; |
| 317 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 317 | p.expect( |
| 318 | format!( | ||
| 319 | "fetching ref list over filesystem from {}...\r\n", | ||
| 320 | source_path | ||
| 321 | ) | ||
| 322 | .as_str(), | ||
| 323 | )?; | ||
| 318 | // println!("{}", p.expect_eventually("\r\n\r\n")?); | 324 | // println!("{}", p.expect_eventually("\r\n\r\n")?); |
| 319 | let res = p.expect_eventually("\r\n\r\n")?; | 325 | let res = p.expect_eventually("\r\n\r\n")?; |
| 320 | p.exit()?; | 326 | p.exit()?; |
| @@ -388,7 +394,13 @@ mod list { | |||
| 388 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 394 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 389 | let mut p = cli_tester_after_fetch(&git_repo)?; | 395 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 390 | p.send_line("list")?; | 396 | p.send_line("list")?; |
| 391 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 397 | p.expect( |
| 398 | format!( | ||
| 399 | "fetching ref list over filesystem from {}...\r\n", | ||
| 400 | source_path | ||
| 401 | ) | ||
| 402 | .as_str(), | ||
| 403 | )?; | ||
| 392 | // println!("{}", p.expect_eventually("\r\n\r\n")?); | 404 | // println!("{}", p.expect_eventually("\r\n\r\n")?); |
| 393 | let res = p.expect_eventually("\r\n\r\n")?; | 405 | let res = p.expect_eventually("\r\n\r\n")?; |
| 394 | p.exit()?; | 406 | p.exit()?; |
| @@ -470,7 +482,13 @@ mod list { | |||
| 470 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 482 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 471 | let mut p = cli_tester_after_fetch(&git_repo)?; | 483 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 472 | p.send_line("list")?; | 484 | p.send_line("list")?; |
| 473 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 485 | p.expect( |
| 486 | format!( | ||
| 487 | "fetching ref list over filesystem from {}...\r\n", | ||
| 488 | source_path | ||
| 489 | ) | ||
| 490 | .as_str(), | ||
| 491 | )?; | ||
| 474 | p.expect( | 492 | p.expect( |
| 475 | format!( | 493 | format!( |
| 476 | "WARNING: {} refs/heads/main is out of sync with nostr \r\n", | 494 | "WARNING: {} refs/heads/main is out of sync with nostr \r\n", |
| @@ -552,7 +570,13 @@ mod list { | |||
| 552 | 570 | ||
| 553 | let mut p = cli_tester_after_fetch(&git_repo)?; | 571 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 554 | p.send_line("list")?; | 572 | p.send_line("list")?; |
| 555 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 573 | p.expect( |
| 574 | format!( | ||
| 575 | "fetching ref list over filesystem from {}...\r\n", | ||
| 576 | source_path | ||
| 577 | ) | ||
| 578 | .as_str(), | ||
| 579 | )?; | ||
| 556 | // println!("{}", p.expect_eventually("\r\n\r\n")?); | 580 | // println!("{}", p.expect_eventually("\r\n\r\n")?); |
| 557 | let res = p.expect_eventually("\r\n\r\n")?; | 581 | let res = p.expect_eventually("\r\n\r\n")?; |
| 558 | 582 | ||
| @@ -659,7 +683,7 @@ mod fetch { | |||
| 659 | p.send_line(format!("fetch {main_commit_id} main").as_str())?; | 683 | p.send_line(format!("fetch {main_commit_id} main").as_str())?; |
| 660 | p.send_line(format!("fetch {vnext_commit_id} vnext").as_str())?; | 684 | p.send_line(format!("fetch {vnext_commit_id} vnext").as_str())?; |
| 661 | p.send_line("")?; | 685 | p.send_line("")?; |
| 662 | p.expect(format!("fetching from {source_path}...\r\n").as_str())?; | 686 | p.expect(format!("fetching over filesystem from {source_path}...\r\n").as_str())?; |
| 663 | p.expect_eventually_and_print("\r\n")?; | 687 | p.expect_eventually_and_print("\r\n")?; |
| 664 | 688 | ||
| 665 | assert!(git_repo.git_repo.find_commit(main_commit_id).is_ok()); | 689 | assert!(git_repo.git_repo.find_commit(main_commit_id).is_ok()); |
| @@ -725,9 +749,10 @@ mod fetch { | |||
| 725 | let mut p = cli_tester_after_fetch(&git_repo)?; | 749 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 726 | p.send_line(format!("fetch {main_commit_id} main").as_str())?; | 750 | p.send_line(format!("fetch {main_commit_id} main").as_str())?; |
| 727 | p.send_line("")?; | 751 | p.send_line("")?; |
| 728 | p.expect(format!("fetching from {error_path}...\r\n").as_str())?; | 752 | p.expect(format!("fetching over filesystem from {error_path}...\r\n").as_str())?; |
| 729 | // not sure why the below isn't appearing | 753 | // not sure why the below isn't appearing |
| 730 | // p.expect(format!("fetching from {source_path}...\r\n").as_str())?; | 754 | // p.expect(format!("fetching over filesystem from |
| 755 | // {source_path}...\r\n").as_str())?; | ||
| 731 | p.expect_eventually_and_print("\r\n")?; | 756 | p.expect_eventually_and_print("\r\n")?; |
| 732 | // p.expect("\r\n")?; | 757 | // p.expect("\r\n")?; |
| 733 | 758 | ||
| @@ -782,7 +807,7 @@ mod fetch { | |||
| 782 | let mut p = cli_tester_after_fetch(&git_repo)?; | 807 | let mut p = cli_tester_after_fetch(&git_repo)?; |
| 783 | p.send_line(format!("fetch {proposal_tip} refs/heads/{branch_name}").as_str())?; | 808 | p.send_line(format!("fetch {proposal_tip} refs/heads/{branch_name}").as_str())?; |
| 784 | p.send_line("")?; | 809 | p.send_line("")?; |
| 785 | p.expect(format!("fetching from {source_path}...\r\n").as_str())?; | 810 | p.expect(format!("fetching over filesystem from {source_path}...\r\n").as_str())?; |
| 786 | // expect no errors | 811 | // expect no errors |
| 787 | p.expect_after_whitespace("\r\n")?; | 812 | p.expect_after_whitespace("\r\n")?; |
| 788 | p.exit()?; | 813 | p.exit()?; |
| @@ -1753,7 +1778,13 @@ mod push { | |||
| 1753 | 1778 | ||
| 1754 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1779 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1755 | cli_expect_nostr_fetch(&mut p)?; | 1780 | cli_expect_nostr_fetch(&mut p)?; |
| 1756 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 1781 | p.expect( |
| 1782 | format!( | ||
| 1783 | "fetching ref list over filesystem from {}...\r\n", | ||
| 1784 | source_path | ||
| 1785 | ) | ||
| 1786 | .as_str(), | ||
| 1787 | )?; | ||
| 1757 | 1788 | ||
| 1758 | p.expect("merge commit ")?; | 1789 | p.expect("merge commit ")?; |
| 1759 | // shorthand merge commit id appears in this gap | 1790 | // shorthand merge commit id appears in this gap |
| @@ -1897,7 +1928,13 @@ mod push { | |||
| 1897 | 1928 | ||
| 1898 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); | 1929 | let mut p = CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push"]); |
| 1899 | cli_expect_nostr_fetch(&mut p)?; | 1930 | cli_expect_nostr_fetch(&mut p)?; |
| 1900 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 1931 | p.expect( |
| 1932 | format!( | ||
| 1933 | "fetching ref list over filesystem from {}...\r\n", | ||
| 1934 | source_path | ||
| 1935 | ) | ||
| 1936 | .as_str(), | ||
| 1937 | )?; | ||
| 1901 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 1938 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 1902 | let output = p.expect_end_eventually()?; | 1939 | let output = p.expect_end_eventually()?; |
| 1903 | 1940 | ||
| @@ -2051,7 +2088,13 @@ mod push { | |||
| 2051 | let mut p = | 2088 | let mut p = |
| 2052 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); | 2089 | CliTester::new_git_with_remote_helper_from_dir(&git_repo.dir, ["push", "--force"]); |
| 2053 | cli_expect_nostr_fetch(&mut p)?; | 2090 | cli_expect_nostr_fetch(&mut p)?; |
| 2054 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 2091 | p.expect( |
| 2092 | format!( | ||
| 2093 | "fetching ref list over filesystem from {}...\r\n", | ||
| 2094 | source_path | ||
| 2095 | ) | ||
| 2096 | .as_str(), | ||
| 2097 | )?; | ||
| 2055 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 2098 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 2056 | let output = p.expect_end_eventually()?; | 2099 | let output = p.expect_end_eventually()?; |
| 2057 | 2100 | ||
| @@ -2201,7 +2244,13 @@ mod push { | |||
| 2201 | ["push", "-u", "origin", branch_name], | 2244 | ["push", "-u", "origin", branch_name], |
| 2202 | ); | 2245 | ); |
| 2203 | cli_expect_nostr_fetch(&mut p)?; | 2246 | cli_expect_nostr_fetch(&mut p)?; |
| 2204 | p.expect(format!("fetching refs list: {}...\r\n\r", source_path).as_str())?; | 2247 | p.expect( |
| 2248 | format!( | ||
| 2249 | "fetching ref list over filesystem from {}...\r\n", | ||
| 2250 | source_path | ||
| 2251 | ) | ||
| 2252 | .as_str(), | ||
| 2253 | )?; | ||
| 2205 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; | 2254 | p.expect(format!("To {}\r\n", get_nostr_remote_url()?).as_str())?; |
| 2206 | let output = p.expect_end_eventually()?; | 2255 | let output = p.expect_end_eventually()?; |
| 2207 | 2256 | ||