diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-19 21:43:47 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-19 21:49:51 +0100 |
| commit | 55fd2693e314a87d32872cd74d3d563cd94201a2 (patch) | |
| tree | 589135b4ca762a65043b5ea98215c4b80f8c29b2 /tests/pull.rs | |
| parent | 8531328558c7f5870be3571f63a952743eb0b9e6 (diff) | |
feat: integrate `fetch` into `pull`
the last set of pull integration test fails:
when_latest_event_rebases_branch
we are planning on replacing pull so I'm not sure
whether it is worth fixing
Diffstat (limited to 'tests/pull.rs')
| -rw-r--r-- | tests/pull.rs | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/tests/pull.rs b/tests/pull.rs index bf132e7..ecd64ff 100644 --- a/tests/pull.rs +++ b/tests/pull.rs | |||
| @@ -218,10 +218,9 @@ mod when_branch_doesnt_exist { | |||
| 218 | test_repo.checkout("random-name")?; | 218 | test_repo.checkout("random-name")?; |
| 219 | 219 | ||
| 220 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 220 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 221 | p.expect("finding proposal root event...\r\n")?; | 221 | p.expect("fetching updates...\r\n")?; |
| 222 | p.expect( | 222 | p.expect_eventually("\r\n")?; // some updates listed here |
| 223 | "Error: cannot find a proposal root event associated with the checked out branch name\r\n", | 223 | p.expect("Error: cannot find proposal that matches the current branch name\r\n")?; |
| 224 | )?; | ||
| 225 | 224 | ||
| 226 | p.expect_end()?; | 225 | p.expect_end()?; |
| 227 | 226 | ||
| @@ -281,8 +280,8 @@ mod when_branch_is_checked_out { | |||
| 281 | create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?; | 280 | create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?; |
| 282 | 281 | ||
| 283 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 282 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 284 | p.expect("finding proposal root event...\r\n")?; | 283 | p.expect("fetching updates...\r\n")?; |
| 285 | p.expect("found proposal root event. finding commits...\r\n")?; | 284 | p.expect_eventually("\r\n")?; // some updates listed here |
| 286 | p.expect("branch already up-to-date\r\n")?; | 285 | p.expect("branch already up-to-date\r\n")?; |
| 287 | p.expect_end()?; | 286 | p.expect_end()?; |
| 288 | 287 | ||
| @@ -391,8 +390,8 @@ mod when_branch_is_checked_out { | |||
| 391 | create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", true)?; | 390 | create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", true)?; |
| 392 | 391 | ||
| 393 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 392 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 394 | p.expect("finding proposal root event...\r\n")?; | 393 | p.expect("fetching updates...\r\n")?; |
| 395 | p.expect("found proposal root event. finding commits...\r\n")?; | 394 | p.expect_eventually("\r\n")?; // some updates listed here |
| 396 | p.expect("applied 1 new commits\r\n")?; | 395 | p.expect("applied 1 new commits\r\n")?; |
| 397 | p.expect_end()?; | 396 | p.expect_end()?; |
| 398 | 397 | ||
| @@ -469,8 +468,8 @@ mod when_branch_is_checked_out { | |||
| 469 | )?; | 468 | )?; |
| 470 | 469 | ||
| 471 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 470 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 472 | p.expect("finding proposal root event...\r\n")?; | 471 | p.expect("fetching updates...\r\n")?; |
| 473 | p.expect("found proposal root event. finding commits...\r\n")?; | 472 | p.expect_eventually("\r\n")?; // some updates listed here |
| 474 | p.expect( | 473 | p.expect( |
| 475 | "you have an amended/rebase version the proposal that is unpublished\r\n", | 474 | "you have an amended/rebase version the proposal that is unpublished\r\n", |
| 476 | )?; | 475 | )?; |
| @@ -547,8 +546,8 @@ mod when_branch_is_checked_out { | |||
| 547 | )?; | 546 | )?; |
| 548 | 547 | ||
| 549 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 548 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 550 | p.expect("finding proposal root event...\r\n")?; | 549 | p.expect("fetching updates...\r\n")?; |
| 551 | p.expect("found proposal root event. finding commits...\r\n")?; | 550 | p.expect_eventually("\r\n")?; // some updates listed here |
| 552 | p.expect( | 551 | p.expect( |
| 553 | "you have an amended/rebase version the proposal that is unpublished\r\n", | 552 | "you have an amended/rebase version the proposal that is unpublished\r\n", |
| 554 | )?; | 553 | )?; |
| @@ -613,8 +612,8 @@ mod when_branch_is_checked_out { | |||
| 613 | test_repo.stage_and_commit("appended commit")?; | 612 | test_repo.stage_and_commit("appended commit")?; |
| 614 | 613 | ||
| 615 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 614 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 616 | p.expect("finding proposal root event...\r\n")?; | 615 | p.expect("fetching updates...\r\n")?; |
| 617 | p.expect("found proposal root event. finding commits...\r\n")?; | 616 | p.expect_eventually("\r\n")?; // some updates listed here |
| 618 | p.expect("local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal\r\n")?; | 617 | p.expect("local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal\r\n")?; |
| 619 | p.expect_end()?; | 618 | p.expect_end()?; |
| 620 | 619 | ||
| @@ -672,8 +671,8 @@ mod when_branch_is_checked_out { | |||
| 672 | test_repo.stage_and_commit("appended commit")?; | 671 | test_repo.stage_and_commit("appended commit")?; |
| 673 | 672 | ||
| 674 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 673 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 675 | p.expect("finding proposal root event...\r\n")?; | 674 | p.expect("fetching updates...\r\n")?; |
| 676 | p.expect("found proposal root event. finding commits...\r\n")?; | 675 | p.expect_eventually("\r\n")?; // some updates listed here |
| 677 | p.expect("local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal\r\n")?; | 676 | p.expect("local proposal branch exists with 1 unpublished commits on top of the most up-to-date version of the proposal\r\n")?; |
| 678 | p.expect_end()?; | 677 | p.expect_end()?; |
| 679 | 678 | ||
| @@ -708,7 +707,6 @@ mod when_branch_is_checked_out { | |||
| 708 | Ok(()) | 707 | Ok(()) |
| 709 | } | 708 | } |
| 710 | } | 709 | } |
| 711 | |||
| 712 | mod when_latest_event_rebases_branch { | 710 | mod when_latest_event_rebases_branch { |
| 713 | use std::time::Duration; | 711 | use std::time::Duration; |
| 714 | 712 | ||
| @@ -895,10 +893,9 @@ mod when_branch_is_checked_out { | |||
| 895 | test_repo.checkout(FEATURE_BRANCH_NAME_1)?; | 893 | test_repo.checkout(FEATURE_BRANCH_NAME_1)?; |
| 896 | 894 | ||
| 897 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); | 895 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]); |
| 898 | p.expect("finding proposal root event...\r\n")?; | 896 | p.expect("fetching updates...\r\n")?; |
| 899 | p.expect("found proposal root event. finding commits...\r\n")?; | 897 | p.expect_eventually("\r\n")?; // some updates listed here |
| 900 | p.expect_end_with("pulled new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; | 898 | p.expect_end_with("pulled new version of proposal (2 ahead 0 behind 'main'), replacing old version (2 ahead 1 behind 'main')\r\n")?; |
| 901 | |||
| 902 | for p in [51, 52, 53, 55, 56] { | 899 | for p in [51, 52, 53, 55, 56] { |
| 903 | relay::shutdown_relay(8000 + p)?; | 900 | relay::shutdown_relay(8000 + p)?; |
| 904 | } | 901 | } |