upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/push.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-19 21:20:53 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-19 21:20:53 +0100
commit8531328558c7f5870be3571f63a952743eb0b9e6 (patch)
treef72b57d2a6e571181d21a55fb03aca70d899cec3 /tests/push.rs
parentfca1d193a46eba17255b5372adffac2396e48c04 (diff)
feat: integrate `fetch` into `push`
as part of a project to use `fetch` and the stored cache everywhere
Diffstat (limited to 'tests/push.rs')
-rw-r--r--tests/push.rs35
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/push.rs b/tests/push.rs
index 65c92e9..1f09d28 100644
--- a/tests/push.rs
+++ b/tests/push.rs
@@ -143,13 +143,11 @@ mod when_proposal_isnt_associated_with_branch_name {
143 test_repo.checkout("random-name")?; 143 test_repo.checkout("random-name")?;
144 144
145 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); 145 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]);
146 p.expect("finding proposal root event...\r\n")?; 146 p.expect("fetching updates...\r\n")?;
147 p.expect( 147 p.expect_eventually("\r\n")?; // some updates listed here
148 "Error: cannot find a proposal root event associated with the checked out branch name\r\n", 148 p.expect_end_with(
149 "Error: cannot find proposal that matches the current branch name\r\n",
149 )?; 150 )?;
150
151 p.expect_end()?;
152
153 for p in [51, 52, 53, 55, 56] { 151 for p in [51, 52, 53, 55, 56] {
154 relay::shutdown_relay(8000 + p)?; 152 relay::shutdown_relay(8000 + p)?;
155 } 153 }
@@ -206,10 +204,9 @@ mod when_branch_is_checked_out {
206 create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?; 204 create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?;
207 205
208 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); 206 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]);
209 p.expect("finding proposal root event...\r\n")?; 207 p.expect("fetching updates...\r\n")?;
210 p.expect("found proposal root event. finding commits...\r\n")?; 208 p.expect_eventually("\r\n")?; // some updates listed here
211 p.expect("Error: proposal already up-to-date with local branch\r\n")?; 209 p.expect_end_with("Error: proposal already up-to-date with local branch\r\n")?;
212 p.expect_end()?;
213 210
214 for p in [51, 52, 53, 55, 56] { 211 for p in [51, 52, 53, 55, 56] {
215 relay::shutdown_relay(8000 + p)?; 212 relay::shutdown_relay(8000 + p)?;
@@ -265,8 +262,8 @@ mod when_branch_is_checked_out {
265 create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", true)?; 262 create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", true)?;
266 263
267 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); 264 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]);
268 p.expect("finding proposal root event...\r\n")?; 265 p.expect("fetching updates...\r\n")?;
269 p.expect("found proposal root event. finding commits...\r\n")?; 266 p.expect_eventually("\r\n")?; // some updates listed here
270 p.expect("Error: proposal is ahead of local branch\r\n")?; 267 p.expect("Error: proposal is ahead of local branch\r\n")?;
271 p.expect_end()?; 268 p.expect_end()?;
272 269
@@ -341,12 +338,11 @@ mod when_branch_is_checked_out {
341 "push", 338 "push",
342 ], 339 ],
343 ); 340 );
344 p.expect("finding proposal root event...\r\n")?; 341 p.expect("fetching updates...\r\n")?;
345 p.expect("found proposal root event. finding commits...\r\n")?; 342 p.expect_eventually("\r\n")?; // some updates listed here
346 p.expect( 343 p.expect(
347 "1 commits ahead. preparing to create creating patch events.\r\n", 344 "1 commits ahead. preparing to create creating patch events.\r\n",
348 )?; 345 )?;
349 p.expect("searching for profile...\r\n")?;
350 p.expect("logged in as fred\r\n")?; 346 p.expect("logged in as fred\r\n")?;
351 p.expect("pushing 1 commits\r\n")?; 347 p.expect("pushing 1 commits\r\n")?;
352 348
@@ -497,8 +493,8 @@ mod when_branch_is_checked_out {
497 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); 493 let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]);
498 // p.expect_end_eventually_and_print()?; 494 // p.expect_end_eventually_and_print()?;
499 495
500 p.expect("finding proposal root event...\r\n")?; 496 p.expect("fetching updates...\r\n")?;
501 p.expect("found proposal root event. finding commits...\r\n")?; 497 p.expect_eventually("\r\n")?; // some updates listed here
502 p.expect("Error: local unpublished proposal has been rebased. consider force pushing\r\n")?; 498 p.expect("Error: local unpublished proposal has been rebased. consider force pushing\r\n")?;
503 p.expect_end()?; 499 p.expect_end()?;
504 500
@@ -568,8 +564,8 @@ mod when_branch_is_checked_out {
568 "--no-cover-letter", 564 "--no-cover-letter",
569 ], 565 ],
570 ); 566 );
571 p.expect("finding proposal root event...\r\n")?; 567 p.expect("fetching updates...\r\n")?;
572 p.expect("found proposal root event. finding commits...\r\n")?; 568 p.expect_eventually("\r\n")?; // some updates listed here
573 p.expect("preparing to force push proposal revision...\r\n")?; 569 p.expect("preparing to force push proposal revision...\r\n")?;
574 // standard output from `ngit send` 570 // standard output from `ngit send`
575 p.expect("creating proposal revision for: ")?; 571 p.expect("creating proposal revision for: ")?;
@@ -591,7 +587,6 @@ mod when_branch_is_checked_out {
591 p.expect("creating proposal from 2 commits:\r\n")?; 587 p.expect("creating proposal from 2 commits:\r\n")?;
592 p.expect("355bdf1 add a4.md\r\n")?; 588 p.expect("355bdf1 add a4.md\r\n")?;
593 p.expect("dbd1115 add a3.md\r\n")?; 589 p.expect("dbd1115 add a3.md\r\n")?;
594 p.expect("searching for profile...\r\n")?;
595 p.expect("logged in as fred\r\n")?; 590 p.expect("logged in as fred\r\n")?;
596 p.expect("posting 2 patches without a covering letter...\r\n")?; 591 p.expect("posting 2 patches without a covering letter...\r\n")?;
597 592