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/push.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/push.rs')
| -rw-r--r-- | tests/push.rs | 69 |
1 files changed, 22 insertions, 47 deletions
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 | } |