upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-03-04 10:54:38 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-03-04 10:54:38 +0000
commitb02b4754c027bd751825c8e3b96766a5898187b1 (patch)
tree5d82b0a1f3094eb5cc7968d4607fd51d713f3bba
parent6e48a90620cc083ab3617a6583123de9e721b181 (diff)
test: ensure failed tests timeout
resolve a long standing test issue where failures to output the correct message in the cli would result in the test never ending rather than failing the many test cases updated in this change are to ensure failures are caught rather than ignored some of them are just refactored to remove calling an extra function, which is no longer needed note: this doesn't fix the intermittent issue, most commonly experienced under the nix configuration, where tests that should pass occationally never end preventing the rest of the suite from running
-rw-r--r--test_utils/src/lib.rs44
-rw-r--r--tests/init.rs11
-rw-r--r--tests/list.rs106
-rw-r--r--tests/pull.rs90
-rw-r--r--tests/push.rs69
-rw-r--r--tests/send.rs77
6 files changed, 145 insertions, 252 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index 8a65d39..712753e 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -646,6 +646,22 @@ impl CliTester {
646 } 646 }
647 } 647 }
648 648
649 fn exp_string(&mut self, message: &str) -> Result<String> {
650 match self
651 .rexpect_session
652 .exp_string(message)
653 .context("expected immediate end but got timed out")
654 {
655 Ok(before) => Ok(before),
656 Err(e) => {
657 for p in [51, 52, 53, 55, 56, 57] {
658 let _ = relay::shutdown_relay(8000 + p);
659 }
660 Err(e)
661 }
662 }
663 }
664
649 /// returns what came before expected message 665 /// returns what came before expected message
650 pub fn expect_eventually<S>(&mut self, message: S) -> Result<String> 666 pub fn expect_eventually<S>(&mut self, message: S) -> Result<String>
651 where 667 where
@@ -653,10 +669,7 @@ impl CliTester {
653 { 669 {
654 let message_string = message.into(); 670 let message_string = message.into();
655 let message = message_string.as_str(); 671 let message = message_string.as_str();
656 let before = self 672 let before = self.exp_string(message).context("exp_string failed")?;
657 .rexpect_session
658 .exp_string(message)
659 .context("exp_string failed")?;
660 Ok(before) 673 Ok(before)
661 } 674 }
662 675
@@ -692,9 +705,24 @@ impl CliTester {
692 Ok(self) 705 Ok(self)
693 } 706 }
694 707
708 fn exp_eof(&mut self) -> Result<String> {
709 match self
710 .rexpect_session
711 .exp_eof()
712 .context("expected immediate end but got timed out")
713 {
714 Ok(before) => Ok(before),
715 Err(e) => {
716 for p in [51, 52, 53, 55, 56, 57] {
717 let _ = relay::shutdown_relay(8000 + p);
718 }
719 Err(e)
720 }
721 }
722 }
723
695 pub fn expect_end(&mut self) -> Result<()> { 724 pub fn expect_end(&mut self) -> Result<()> {
696 let before = self 725 let before = self
697 .rexpect_session
698 .exp_eof() 726 .exp_eof()
699 .context("expected immediate end but got timed out")?; 727 .context("expected immediate end but got timed out")?;
700 ensure!( 728 ensure!(
@@ -709,7 +737,6 @@ impl CliTester {
709 737
710 pub fn expect_end_with(&mut self, message: &str) -> Result<()> { 738 pub fn expect_end_with(&mut self, message: &str) -> Result<()> {
711 let before = self 739 let before = self
712 .rexpect_session
713 .exp_eof() 740 .exp_eof()
714 .context("expected immediate end but got timed out")?; 741 .context("expected immediate end but got timed out")?;
715 assert_eq!(before, message); 742 assert_eq!(before, message);
@@ -718,7 +745,6 @@ impl CliTester {
718 745
719 pub fn expect_end_eventually_and_print(&mut self) -> Result<()> { 746 pub fn expect_end_eventually_and_print(&mut self) -> Result<()> {
720 let before = self 747 let before = self
721 .rexpect_session
722 .exp_eof() 748 .exp_eof()
723 .context("expected immediate end but got timed out")?; 749 .context("expected immediate end but got timed out")?;
724 println!("ended eventually with:"); 750 println!("ended eventually with:");
@@ -728,7 +754,6 @@ impl CliTester {
728 754
729 pub fn expect_end_with_whitespace(&mut self) -> Result<()> { 755 pub fn expect_end_with_whitespace(&mut self) -> Result<()> {
730 let before = self 756 let before = self
731 .rexpect_session
732 .exp_eof() 757 .exp_eof()
733 .context("expected immediate end but got timed out")?; 758 .context("expected immediate end but got timed out")?;
734 assert_eq!(before.trim(), ""); 759 assert_eq!(before.trim(), "");
@@ -736,8 +761,7 @@ impl CliTester {
736 } 761 }
737 762
738 pub fn expect_end_eventually(&mut self) -> Result<String> { 763 pub fn expect_end_eventually(&mut self) -> Result<String> {
739 self.rexpect_session 764 self.exp_eof()
740 .exp_eof()
741 .context("expected end eventually but got timed out") 765 .context("expected end eventually but got timed out")
742 } 766 }
743 767
diff --git a/tests/init.rs b/tests/init.rs
index 7c69784..2083c82 100644
--- a/tests/init.rs
+++ b/tests/init.rs
@@ -441,7 +441,9 @@ mod when_repo_not_previously_claimed {
441 mod cli_ouput { 441 mod cli_ouput {
442 use super::*; 442 use super::*;
443 443
444 async fn run_test_async() -> Result<()> { 444 #[tokio::test]
445 #[serial]
446 async fn check_cli_output() -> Result<()> {
445 let git_repo = prep_git_repo()?; 447 let git_repo = prep_git_repo()?;
446 448
447 // fallback (51,52) user write (53, 55) repo (55, 56) blaster (57) 449 // fallback (51,52) user write (53, 55) repo (55, 56) blaster (57)
@@ -504,13 +506,6 @@ mod when_repo_not_previously_claimed {
504 cli_tester_handle.join().unwrap()?; 506 cli_tester_handle.join().unwrap()?;
505 Ok(()) 507 Ok(())
506 } 508 }
507
508 #[tokio::test]
509 #[serial]
510 async fn check_cli_output() -> Result<()> {
511 run_test_async().await?;
512 Ok(())
513 }
514 } 509 }
515 } 510 }
516 // TODO: cli caputuring input 511 // TODO: cli caputuring input
diff --git a/tests/list.rs b/tests/list.rs
index 6d161ea..7e12dc1 100644
--- a/tests/list.rs
+++ b/tests/list.rs
@@ -219,22 +219,19 @@ mod cannot_find_repo_event {
219 #[tokio::test] 219 #[tokio::test]
220 #[serial] 220 #[serial]
221 async fn warns_not_valid_input_and_asks_again() -> Result<()> { 221 async fn warns_not_valid_input_and_asks_again() -> Result<()> {
222 let _ = run_async_repo_event_ref_needed(true, false, false).await; 222 run_async_repo_event_ref_needed(true, false, false).await
223 Ok(())
224 } 223 }
225 224
226 #[tokio::test] 225 #[tokio::test]
227 #[serial] 226 #[serial]
228 async fn finds_based_on_nevent_on_embeded_relay() -> Result<()> { 227 async fn finds_based_on_nevent_on_embeded_relay() -> Result<()> {
229 let _ = run_async_repo_event_ref_needed(false, true, false).await; 228 run_async_repo_event_ref_needed(false, true, false).await
230 Ok(())
231 } 229 }
232 230
233 #[tokio::test] 231 #[tokio::test]
234 #[serial] 232 #[serial]
235 async fn finds_based_on_naddr_on_embeded_relay() -> Result<()> { 233 async fn finds_based_on_naddr_on_embeded_relay() -> Result<()> {
236 let _ = run_async_repo_event_ref_needed(false, false, true).await; 234 run_async_repo_event_ref_needed(false, false, true).await
237 Ok(())
238 } 235 }
239 } 236 }
240} 237}
@@ -327,7 +324,9 @@ mod when_main_branch_is_uptodate {
327 324
328 mod cli_prompts { 325 mod cli_prompts {
329 use super::*; 326 use super::*;
330 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 327 #[tokio::test]
328 #[serial]
329 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
331 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 330 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
332 Relay::new(8051, None, None), 331 Relay::new(8051, None, None),
333 Relay::new(8052, None, None), 332 Relay::new(8052, None, None),
@@ -396,13 +395,6 @@ mod when_main_branch_is_uptodate {
396 println!("{:?}", r55.events); 395 println!("{:?}", r55.events);
397 Ok(()) 396 Ok(())
398 } 397 }
399
400 #[tokio::test]
401 #[serial]
402 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
403 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
404 Ok(())
405 }
406 } 398 }
407 399
408 #[tokio::test] 400 #[tokio::test]
@@ -517,7 +509,10 @@ mod when_main_branch_is_uptodate {
517 509
518 mod cli_prompts { 510 mod cli_prompts {
519 use super::*; 511 use super::*;
520 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 512
513 #[tokio::test]
514 #[serial]
515 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
521 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 516 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
522 Relay::new(8051, None, None), 517 Relay::new(8051, None, None),
523 Relay::new(8052, None, None), 518 Relay::new(8052, None, None),
@@ -586,13 +581,6 @@ mod when_main_branch_is_uptodate {
586 println!("{:?}", r55.events); 581 println!("{:?}", r55.events);
587 Ok(()) 582 Ok(())
588 } 583 }
589
590 #[tokio::test]
591 #[serial]
592 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
593 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
594 Ok(())
595 }
596 } 584 }
597 585
598 #[tokio::test] 586 #[tokio::test]
@@ -713,7 +701,10 @@ mod when_main_branch_is_uptodate {
713 701
714 mod cli_prompts { 702 mod cli_prompts {
715 use super::*; 703 use super::*;
716 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 704
705 #[tokio::test]
706 #[serial]
707 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
717 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 708 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
718 Relay::new(8051, None, None), 709 Relay::new(8051, None, None),
719 Relay::new(8052, None, None), 710 Relay::new(8052, None, None),
@@ -789,13 +780,6 @@ mod when_main_branch_is_uptodate {
789 println!("{:?}", r55.events); 780 println!("{:?}", r55.events);
790 Ok(()) 781 Ok(())
791 } 782 }
792
793 #[tokio::test]
794 #[serial]
795 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
796 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
797 Ok(())
798 }
799 } 783 }
800 784
801 #[tokio::test] 785 #[tokio::test]
@@ -922,7 +906,10 @@ mod when_main_branch_is_uptodate {
922 906
923 mod cli_prompts { 907 mod cli_prompts {
924 use super::*; 908 use super::*;
925 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 909
910 #[tokio::test]
911 #[serial]
912 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
926 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 913 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
927 Relay::new(8051, None, None), 914 Relay::new(8051, None, None),
928 Relay::new(8052, None, None), 915 Relay::new(8052, None, None),
@@ -998,13 +985,6 @@ mod when_main_branch_is_uptodate {
998 println!("{:?}", r55.events); 985 println!("{:?}", r55.events);
999 Ok(()) 986 Ok(())
1000 } 987 }
1001
1002 #[tokio::test]
1003 #[serial]
1004 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1005 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
1006 Ok(())
1007 }
1008 } 988 }
1009 989
1010 #[tokio::test] 990 #[tokio::test]
@@ -1102,7 +1082,10 @@ mod when_main_branch_is_uptodate {
1102 1082
1103 mod cli_prompts { 1083 mod cli_prompts {
1104 use super::*; 1084 use super::*;
1105 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 1085
1086 #[tokio::test]
1087 #[serial]
1088 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1106 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1089 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
1107 Relay::new(8051, None, None), 1090 Relay::new(8051, None, None),
1108 Relay::new(8052, None, None), 1091 Relay::new(8052, None, None),
@@ -1176,13 +1159,6 @@ mod when_main_branch_is_uptodate {
1176 println!("{:?}", r55.events); 1159 println!("{:?}", r55.events);
1177 Ok(()) 1160 Ok(())
1178 } 1161 }
1179
1180 #[tokio::test]
1181 #[serial]
1182 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1183 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
1184 Ok(())
1185 }
1186 } 1162 }
1187 1163
1188 #[tokio::test] 1164 #[tokio::test]
@@ -1302,7 +1278,11 @@ mod when_main_branch_is_uptodate {
1302 1278
1303 mod cli_prompts { 1279 mod cli_prompts {
1304 use super::*; 1280 use super::*;
1305 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 1281
1282 #[tokio::test]
1283 #[serial]
1284 async fn out_reflects_second_choice_discarding_old_and_applying_new()
1285 -> Result<()> {
1306 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1286 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
1307 Relay::new(8051, None, None), 1287 Relay::new(8051, None, None),
1308 Relay::new(8052, None, None), 1288 Relay::new(8052, None, None),
@@ -1393,14 +1373,6 @@ mod when_main_branch_is_uptodate {
1393 println!("{:?}", r55.events); 1373 println!("{:?}", r55.events);
1394 Ok(()) 1374 Ok(())
1395 } 1375 }
1396
1397 #[tokio::test]
1398 #[serial]
1399 async fn out_reflects_second_choice_discarding_old_and_applying_new()
1400 -> Result<()> {
1401 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
1402 Ok(())
1403 }
1404 } 1376 }
1405 1377
1406 #[tokio::test] 1378 #[tokio::test]
@@ -1504,7 +1476,10 @@ mod when_main_branch_is_uptodate {
1504 1476
1505 mod cli_prompts { 1477 mod cli_prompts {
1506 use super::*; 1478 use super::*;
1507 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 1479
1480 #[tokio::test]
1481 #[serial]
1482 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1508 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1483 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
1509 Relay::new(8051, None, None), 1484 Relay::new(8051, None, None),
1510 Relay::new(8052, None, None), 1485 Relay::new(8052, None, None),
@@ -1583,13 +1558,6 @@ mod when_main_branch_is_uptodate {
1583 println!("{:?}", r55.events); 1558 println!("{:?}", r55.events);
1584 Ok(()) 1559 Ok(())
1585 } 1560 }
1586
1587 #[tokio::test]
1588 #[serial]
1589 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1590 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
1591 Ok(())
1592 }
1593 } 1561 }
1594 1562
1595 #[tokio::test] 1563 #[tokio::test]
@@ -1746,7 +1714,10 @@ mod when_main_branch_is_uptodate {
1746 1714
1747 mod cli_prompts { 1715 mod cli_prompts {
1748 use super::*; 1716 use super::*;
1749 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 1717
1718 #[tokio::test]
1719 #[serial]
1720 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1750 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1721 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
1751 Relay::new(8051, None, None), 1722 Relay::new(8051, None, None),
1752 Relay::new(8052, None, None), 1723 Relay::new(8052, None, None),
@@ -1866,13 +1837,6 @@ mod when_main_branch_is_uptodate {
1866 println!("{:?}", r55.events); 1837 println!("{:?}", r55.events);
1867 Ok(()) 1838 Ok(())
1868 } 1839 }
1869
1870 #[tokio::test]
1871 #[serial]
1872 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
1873 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
1874 Ok(())
1875 }
1876 } 1840 }
1877 1841
1878 #[tokio::test] 1842 #[tokio::test]
diff --git a/tests/pull.rs b/tests/pull.rs
index ee8cad1..77ff87b 100644
--- a/tests/pull.rs
+++ b/tests/pull.rs
@@ -127,7 +127,10 @@ mod when_main_is_checked_out {
127 127
128 mod cli_prompts { 128 mod cli_prompts {
129 use super::*; 129 use super::*;
130 async fn run_async_cli_show_error() -> Result<()> { 130
131 #[tokio::test]
132 #[serial]
133 async fn cli_show_error() -> Result<()> {
131 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 134 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
132 Relay::new(8051, None, None), 135 Relay::new(8051, None, None),
133 Relay::new(8052, None, None), 136 Relay::new(8052, None, None),
@@ -174,12 +177,6 @@ mod when_main_is_checked_out {
174 cli_tester_handle.join().unwrap()?; 177 cli_tester_handle.join().unwrap()?;
175 Ok(()) 178 Ok(())
176 } 179 }
177
178 #[tokio::test]
179 #[serial]
180 async fn cli_show_error() -> Result<()> {
181 run_async_cli_show_error().await
182 }
183 } 180 }
184} 181}
185 182
@@ -188,7 +185,10 @@ mod when_branch_doesnt_exist {
188 185
189 mod cli_prompts { 186 mod cli_prompts {
190 use super::*; 187 use super::*;
191 async fn run_async_cli_show_error() -> Result<()> { 188
189 #[tokio::test]
190 #[serial]
191 async fn cli_show_error() -> Result<()> {
192 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 192 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
193 Relay::new(8051, None, None), 193 Relay::new(8051, None, None),
194 Relay::new(8052, None, None), 194 Relay::new(8052, None, None),
@@ -239,12 +239,6 @@ mod when_branch_doesnt_exist {
239 cli_tester_handle.join().unwrap()?; 239 cli_tester_handle.join().unwrap()?;
240 Ok(()) 240 Ok(())
241 } 241 }
242
243 #[tokio::test]
244 #[serial]
245 async fn cli_show_error() -> Result<()> {
246 run_async_cli_show_error().await
247 }
248 } 242 }
249} 243}
250 244
@@ -256,7 +250,9 @@ mod when_branch_is_checked_out {
256 250
257 mod cli_prompts { 251 mod cli_prompts {
258 use super::*; 252 use super::*;
259 async fn run_async_cli_show_up_to_date() -> Result<()> { 253 #[tokio::test]
254 #[serial]
255 async fn cli_show_up_to_date() -> Result<()> {
260 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 256 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
261 Relay::new(8051, None, None), 257 Relay::new(8051, None, None),
262 Relay::new(8052, None, None), 258 Relay::new(8052, None, None),
@@ -304,12 +300,6 @@ mod when_branch_is_checked_out {
304 cli_tester_handle.join().unwrap()?; 300 cli_tester_handle.join().unwrap()?;
305 Ok(()) 301 Ok(())
306 } 302 }
307
308 #[tokio::test]
309 #[serial]
310 async fn cli_show_up_to_date() -> Result<()> {
311 run_async_cli_show_up_to_date().await
312 }
313 } 303 }
314 } 304 }
315 305
@@ -368,7 +358,9 @@ mod when_branch_is_checked_out {
368 mod cli_prompts { 358 mod cli_prompts {
369 use super::*; 359 use super::*;
370 360
371 async fn run_async_cli_applied_1_commit() -> Result<()> { 361 #[tokio::test]
362 #[serial]
363 async fn cli_applied_1_commit() -> Result<()> {
372 // fallback (51,52) user write (53, 55) repo (55, 56) 364 // fallback (51,52) user write (53, 55) repo (55, 56)
373 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 365 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
374 Relay::new(8051, None, None), 366 Relay::new(8051, None, None),
@@ -419,12 +411,6 @@ mod when_branch_is_checked_out {
419 411
420 Ok(()) 412 Ok(())
421 } 413 }
422
423 #[tokio::test]
424 #[serial]
425 async fn cli_applied_1_commit() -> Result<()> {
426 run_async_cli_applied_1_commit().await
427 }
428 } 414 }
429 415
430 #[tokio::test] 416 #[tokio::test]
@@ -444,7 +430,10 @@ mod when_branch_is_checked_out {
444 430
445 mod cli_prompts { 431 mod cli_prompts {
446 use super::*; 432 use super::*;
447 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 433
434 #[tokio::test]
435 #[serial]
436 async fn cli_output_correct() -> Result<()> {
448 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 437 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
449 Relay::new(8051, None, None), 438 Relay::new(8051, None, None),
450 Relay::new(8052, None, None), 439 Relay::new(8052, None, None),
@@ -509,13 +498,6 @@ mod when_branch_is_checked_out {
509 println!("{:?}", r55.events); 498 println!("{:?}", r55.events);
510 Ok(()) 499 Ok(())
511 } 500 }
512
513 #[tokio::test]
514 #[serial]
515 async fn cli_output_correct() -> Result<()> {
516 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
517 Ok(())
518 }
519 } 501 }
520 } 502 }
521 503
@@ -524,7 +506,10 @@ mod when_branch_is_checked_out {
524 506
525 mod cli_prompts { 507 mod cli_prompts {
526 use super::*; 508 use super::*;
527 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 509
510 #[tokio::test]
511 #[serial]
512 async fn cli_output_correct() -> Result<()> {
528 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 513 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
529 Relay::new(8051, None, None), 514 Relay::new(8051, None, None),
530 Relay::new(8052, None, None), 515 Relay::new(8052, None, None),
@@ -589,13 +574,6 @@ mod when_branch_is_checked_out {
589 println!("{:?}", r55.events); 574 println!("{:?}", r55.events);
590 Ok(()) 575 Ok(())
591 } 576 }
592
593 #[tokio::test]
594 #[serial]
595 async fn cli_output_correct() -> Result<()> {
596 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
597 Ok(())
598 }
599 } 577 }
600 } 578 }
601 579
@@ -659,7 +637,10 @@ mod when_branch_is_checked_out {
659 637
660 mod cli_prompts { 638 mod cli_prompts {
661 use super::*; 639 use super::*;
662 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 640
641 #[tokio::test]
642 #[serial]
643 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
663 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 644 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
664 Relay::new(8051, None, None), 645 Relay::new(8051, None, None),
665 Relay::new(8052, None, None), 646 Relay::new(8052, None, None),
@@ -711,13 +692,6 @@ mod when_branch_is_checked_out {
711 println!("{:?}", r55.events); 692 println!("{:?}", r55.events);
712 Ok(()) 693 Ok(())
713 } 694 }
714
715 #[tokio::test]
716 #[serial]
717 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
718 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
719 Ok(())
720 }
721 } 695 }
722 696
723 #[tokio::test] 697 #[tokio::test]
@@ -835,7 +809,10 @@ mod when_branch_is_checked_out {
835 809
836 mod cli_prompts { 810 mod cli_prompts {
837 use super::*; 811 use super::*;
838 async fn run_async_prompts_to_choose_from_proposal_titles() -> Result<()> { 812
813 #[tokio::test]
814 #[serial]
815 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
839 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 816 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
840 Relay::new(8051, None, None), 817 Relay::new(8051, None, None),
841 Relay::new(8052, None, None), 818 Relay::new(8052, None, None),
@@ -928,13 +905,6 @@ mod when_branch_is_checked_out {
928 println!("{:?}", r55.events); 905 println!("{:?}", r55.events);
929 Ok(()) 906 Ok(())
930 } 907 }
931
932 #[tokio::test]
933 #[serial]
934 async fn prompts_to_choose_from_proposal_titles() -> Result<()> {
935 let _ = run_async_prompts_to_choose_from_proposal_titles().await;
936 Ok(())
937 }
938 } 908 }
939 909
940 #[tokio::test] 910 #[tokio::test]
diff --git a/tests/push.rs b/tests/push.rs
index d295c01..db7a8b8 100644
--- a/tests/push.rs
+++ b/tests/push.rs
@@ -112,7 +112,10 @@ mod when_proposal_isnt_associated_with_branch_name {
112 mod cli_prompts { 112 mod cli_prompts {
113 113
114 use super::*; 114 use super::*;
115 async fn run_async_cli_show_error() -> Result<()> { 115
116 #[tokio::test]
117 #[serial]
118 async fn cli_show_error() -> Result<()> {
116 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 119 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
117 Relay::new(8051, None, None), 120 Relay::new(8051, None, None),
118 Relay::new(8052, None, None), 121 Relay::new(8052, None, None),
@@ -163,12 +166,6 @@ mod when_proposal_isnt_associated_with_branch_name {
163 cli_tester_handle.join().unwrap()?; 166 cli_tester_handle.join().unwrap()?;
164 Ok(()) 167 Ok(())
165 } 168 }
166
167 #[tokio::test]
168 #[serial]
169 async fn cli_show_error() -> Result<()> {
170 run_async_cli_show_error().await
171 }
172 } 169 }
173} 170}
174 171
@@ -180,7 +177,9 @@ mod when_branch_is_checked_out {
180 177
181 mod cli_prompts { 178 mod cli_prompts {
182 use super::*; 179 use super::*;
183 async fn run_async_cli_show_up_to_date() -> Result<()> { 180 #[tokio::test]
181 #[serial]
182 async fn cli_show_up_to_date() -> Result<()> {
184 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 183 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
185 Relay::new(8051, None, None), 184 Relay::new(8051, None, None),
186 Relay::new(8052, None, None), 185 Relay::new(8052, None, None),
@@ -228,13 +227,6 @@ mod when_branch_is_checked_out {
228 cli_tester_handle.join().unwrap()?; 227 cli_tester_handle.join().unwrap()?;
229 Ok(()) 228 Ok(())
230 } 229 }
231
232 #[tokio::test]
233 #[serial]
234 async fn cli_show_up_to_date() -> Result<()> {
235 let _ = run_async_cli_show_up_to_date().await;
236 Ok(())
237 }
238 } 230 }
239 } 231 }
240 232
@@ -243,7 +235,10 @@ mod when_branch_is_checked_out {
243 235
244 mod cli_prompts { 236 mod cli_prompts {
245 use super::*; 237 use super::*;
246 async fn run_async_cli_shows_proposal_ahead_error() -> Result<()> { 238
239 #[tokio::test]
240 #[serial]
241 async fn cli_show_proposal_ahead_error() -> Result<()> {
247 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 242 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
248 Relay::new(8051, None, None), 243 Relay::new(8051, None, None),
249 Relay::new(8052, None, None), 244 Relay::new(8052, None, None),
@@ -291,13 +286,6 @@ mod when_branch_is_checked_out {
291 cli_tester_handle.join().unwrap()?; 286 cli_tester_handle.join().unwrap()?;
292 Ok(()) 287 Ok(())
293 } 288 }
294
295 #[tokio::test]
296 #[serial]
297 async fn cli_show_proposal_ahead_error() -> Result<()> {
298 let _ = run_async_cli_shows_proposal_ahead_error().await;
299 Ok(())
300 }
301 } 289 }
302 } 290 }
303 291
@@ -309,7 +297,9 @@ mod when_branch_is_checked_out {
309 297
310 use super::*; 298 use super::*;
311 299
312 async fn run_async_cli_applied_1_commit() -> Result<()> { 300 #[tokio::test]
301 #[serial]
302 async fn cli_applied_1_commit() -> Result<()> {
313 // fallback (51,52) user write (53, 55) repo (55, 56) 303 // fallback (51,52) user write (53, 55) repo (55, 56)
314 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 304 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
315 Relay::new(8051, None, None), 305 Relay::new(8051, None, None),
@@ -392,13 +382,6 @@ mod when_branch_is_checked_out {
392 382
393 Ok(()) 383 Ok(())
394 } 384 }
395
396 #[tokio::test]
397 #[serial]
398 async fn cli_applied_1_commit() -> Result<()> {
399 let _ = run_async_cli_applied_1_commit().await;
400 Ok(())
401 }
402 } 385 }
403 386
404 async fn prep_and_run() -> Result<(GitTestRepo, Vec<nostr::Event>)> { 387 async fn prep_and_run() -> Result<(GitTestRepo, Vec<nostr::Event>)> {
@@ -480,7 +463,10 @@ mod when_branch_is_checked_out {
480 463
481 mod cli_prompts { 464 mod cli_prompts {
482 use super::*; 465 use super::*;
483 async fn run_async_cli_shows_unpublished_rebase_error() -> Result<()> { 466
467 #[tokio::test]
468 #[serial]
469 async fn cli_shows_unpublished_rebase_error() -> Result<()> {
484 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 470 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
485 Relay::new(8051, None, None), 471 Relay::new(8051, None, None),
486 Relay::new(8052, None, None), 472 Relay::new(8052, None, None),
@@ -533,20 +519,16 @@ mod when_branch_is_checked_out {
533 cli_tester_handle.join().unwrap()?; 519 cli_tester_handle.join().unwrap()?;
534 Ok(()) 520 Ok(())
535 } 521 }
536
537 #[tokio::test]
538 #[serial]
539 async fn cli_shows_unpublished_rebase_error() -> Result<()> {
540 let _ = run_async_cli_shows_unpublished_rebase_error().await;
541 Ok(())
542 }
543 } 522 }
544 mod with_force_flag { 523 mod with_force_flag {
545 use super::*; 524 use super::*;
546 525
547 mod cli_prompts { 526 mod cli_prompts {
548 use super::*; 527 use super::*;
549 async fn run_async_cli_shows_revision_sent() -> Result<()> { 528
529 #[tokio::test]
530 #[serial]
531 async fn cli_shows_revision_sent() -> Result<()> {
550 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 532 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
551 Relay::new(8051, None, None), 533 Relay::new(8051, None, None),
552 Relay::new(8052, None, None), 534 Relay::new(8052, None, None),
@@ -633,13 +615,6 @@ mod when_branch_is_checked_out {
633 cli_tester_handle.join().unwrap()?; 615 cli_tester_handle.join().unwrap()?;
634 Ok(()) 616 Ok(())
635 } 617 }
636
637 #[tokio::test]
638 #[serial]
639 async fn cli_shows_revision_sent() -> Result<()> {
640 let _ = run_async_cli_shows_revision_sent().await;
641 Ok(())
642 }
643 } 618 }
644 } 619 }
645 } 620 }
diff --git a/tests/send.rs b/tests/send.rs
index 4e1adf4..3c619a4 100644
--- a/tests/send.rs
+++ b/tests/send.rs
@@ -696,7 +696,9 @@ mod sends_cover_letter_and_2_patches_to_3_relays {
696 mod cli_ouput { 696 mod cli_ouput {
697 use super::*; 697 use super::*;
698 698
699 async fn run_test_async() -> Result<()> { 699 #[tokio::test]
700 #[serial]
701 async fn check_cli_output() -> Result<()> {
700 let git_repo = prep_git_repo()?; 702 let git_repo = prep_git_repo()?;
701 703
702 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 704 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -765,13 +767,6 @@ mod sends_cover_letter_and_2_patches_to_3_relays {
765 cli_tester_handle.join().unwrap()?; 767 cli_tester_handle.join().unwrap()?;
766 Ok(()) 768 Ok(())
767 } 769 }
768
769 #[tokio::test]
770 #[serial]
771 async fn check_cli_output() -> Result<()> {
772 run_test_async().await?;
773 Ok(())
774 }
775 } 770 }
776 771
777 mod first_event_rejected_by_1_relay { 772 mod first_event_rejected_by_1_relay {
@@ -780,7 +775,9 @@ mod sends_cover_letter_and_2_patches_to_3_relays {
780 mod only_first_rejected_event_sent_to_relay { 775 mod only_first_rejected_event_sent_to_relay {
781 use super::*; 776 use super::*;
782 777
783 async fn run_test_async() -> Result<()> { 778 #[tokio::test]
779 #[serial]
780 async fn only_first_rejected_event_sent_to_relay() -> Result<()> {
784 let git_repo = prep_git_repo()?; 781 let git_repo = prep_git_repo()?;
785 782
786 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 783 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -847,19 +844,14 @@ mod sends_cover_letter_and_2_patches_to_3_relays {
847 844
848 Ok(()) 845 Ok(())
849 } 846 }
850
851 #[tokio::test]
852 #[serial]
853 async fn only_first_rejected_event_sent_to_relay() -> Result<()> {
854 run_test_async().await?;
855 Ok(())
856 }
857 } 847 }
858 848
859 mod cli_show_rejection_with_comment { 849 mod cli_show_rejection_with_comment {
860 use super::*; 850 use super::*;
861 851
862 async fn run_test_async() -> Result<(Relay<'static>, Relay<'static>, Relay<'static>)> { 852 #[tokio::test]
853 #[serial]
854 async fn cli_show_rejection_with_comment() -> Result<()> {
863 let git_repo = prep_git_repo()?; 855 let git_repo = prep_git_repo()?;
864 856
865 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 857 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -939,13 +931,6 @@ mod sends_cover_letter_and_2_patches_to_3_relays {
939 r56.listen_until_close(), 931 r56.listen_until_close(),
940 ); 932 );
941 cli_tester_handle.join().unwrap()?; 933 cli_tester_handle.join().unwrap()?;
942 Ok((r51, r52, r53))
943 }
944
945 #[tokio::test]
946 #[serial]
947 async fn cli_show_rejection_with_comment() -> Result<()> {
948 run_test_async().await?;
949 Ok(()) 934 Ok(())
950 } 935 }
951 } 936 }
@@ -958,7 +943,9 @@ mod sends_2_patches_without_cover_letter {
958 mod cli_ouput { 943 mod cli_ouput {
959 use super::*; 944 use super::*;
960 945
961 async fn run_test_async() -> Result<()> { 946 #[tokio::test]
947 #[serial]
948 async fn check_cli_output() -> Result<()> {
962 let git_repo = prep_git_repo()?; 949 let git_repo = prep_git_repo()?;
963 950
964 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 951 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -1028,13 +1015,6 @@ mod sends_2_patches_without_cover_letter {
1028 cli_tester_handle.join().unwrap()?; 1015 cli_tester_handle.join().unwrap()?;
1029 Ok(()) 1016 Ok(())
1030 } 1017 }
1031
1032 #[tokio::test]
1033 #[serial]
1034 async fn check_cli_output() -> Result<()> {
1035 run_test_async().await?;
1036 Ok(())
1037 }
1038 } 1018 }
1039 1019
1040 #[tokio::test] 1020 #[tokio::test]
@@ -1239,7 +1219,9 @@ mod when_on_main_branch_defaults_to_last_commit {
1239 mod cli_ouput { 1219 mod cli_ouput {
1240 use super::*; 1220 use super::*;
1241 1221
1242 async fn run_test_async() -> Result<()> { 1222 #[tokio::test]
1223 #[serial]
1224 async fn check_cli_output() -> Result<()> {
1243 let git_repo = prep_git_repo()?; 1225 let git_repo = prep_git_repo()?;
1244 1226
1245 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1227 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -1309,13 +1291,6 @@ mod when_on_main_branch_defaults_to_last_commit {
1309 cli_tester_handle.join().unwrap()?; 1291 cli_tester_handle.join().unwrap()?;
1310 Ok(()) 1292 Ok(())
1311 } 1293 }
1312
1313 #[tokio::test]
1314 #[serial]
1315 async fn check_cli_output() -> Result<()> {
1316 run_test_async().await?;
1317 Ok(())
1318 }
1319 } 1294 }
1320 1295
1321 #[tokio::test] 1296 #[tokio::test]
@@ -1431,7 +1406,9 @@ mod specify_starting_commits_whist_on_main_branch {
1431 mod cli_ouput { 1406 mod cli_ouput {
1432 use super::*; 1407 use super::*;
1433 1408
1434 async fn run_test_async() -> Result<()> { 1409 #[tokio::test]
1410 #[serial]
1411 async fn check_cli_output() -> Result<()> {
1435 let git_repo = prep_git_repo()?; 1412 let git_repo = prep_git_repo()?;
1436 1413
1437 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1414 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -1501,13 +1478,6 @@ mod specify_starting_commits_whist_on_main_branch {
1501 cli_tester_handle.join().unwrap()?; 1478 cli_tester_handle.join().unwrap()?;
1502 Ok(()) 1479 Ok(())
1503 } 1480 }
1504
1505 #[tokio::test]
1506 #[serial]
1507 async fn check_cli_output() -> Result<()> {
1508 run_test_async().await?;
1509 Ok(())
1510 }
1511 } 1481 }
1512 1482
1513 #[tokio::test] 1483 #[tokio::test]
@@ -1691,7 +1661,9 @@ mod specify_in_reply_to {
1691 mod cli_ouput { 1661 mod cli_ouput {
1692 use super::*; 1662 use super::*;
1693 1663
1694 async fn run_test_async() -> Result<()> { 1664 #[tokio::test]
1665 #[serial]
1666 async fn check_cli_output() -> Result<()> {
1695 let git_repo = prep_git_repo()?; 1667 let git_repo = prep_git_repo()?;
1696 1668
1697 let (mut r51, mut r52, mut r53, mut r55, mut r56) = ( 1669 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
@@ -1761,13 +1733,6 @@ mod specify_in_reply_to {
1761 cli_tester_handle.join().unwrap()?; 1733 cli_tester_handle.join().unwrap()?;
1762 Ok(()) 1734 Ok(())
1763 } 1735 }
1764
1765 #[tokio::test]
1766 #[serial]
1767 async fn check_cli_output() -> Result<()> {
1768 run_test_async().await?;
1769 Ok(())
1770 }
1771 } 1736 }
1772 1737
1773 mod cover_letter_tags { 1738 mod cover_letter_tags {