diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 10:54:38 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 10:54:38 +0000 |
| commit | b02b4754c027bd751825c8e3b96766a5898187b1 (patch) | |
| tree | 5d82b0a1f3094eb5cc7968d4607fd51d713f3bba /tests/send.rs | |
| parent | 6e48a90620cc083ab3617a6583123de9e721b181 (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/send.rs')
| -rw-r--r-- | tests/send.rs | 77 |
1 files changed, 21 insertions, 56 deletions
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 { |