upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/list.rs
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 /tests/list.rs
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
Diffstat (limited to 'tests/list.rs')
-rw-r--r--tests/list.rs106
1 files changed, 35 insertions, 71 deletions
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]