@@ -467,57 +467,73 @@ mod tests {
467
467
468
468
#[ sqlx:: test]
469
469
async fn auto_build_success_comment ( pool : sqlx:: PgPool ) {
470
- run_test ( pool, |mut tester| async {
471
- tester. create_branch ( AUTO_BRANCH_NAME ) . expect_suites ( 1 ) ;
470
+ let github = GitHubState :: default ( ) . with_default_config (
471
+ r#"
472
+ merge_queue_enabled = true
473
+ "# ,
474
+ ) ;
472
475
473
- tester. post_comment ( "@bors r+" ) . await ?;
474
- tester. expect_comments ( 1 ) . await ;
476
+ BorsBuilder :: new ( pool)
477
+ . github ( github)
478
+ . run_test ( |mut tester| async {
479
+ tester. create_branch ( AUTO_BRANCH_NAME ) . expect_suites ( 1 ) ;
475
480
476
- tester. process_merge_queue ( ) . await ;
477
- tester. expect_comments ( 1 ) . await ;
481
+ tester. post_comment ( "@bors r+" ) . await ? ;
482
+ tester. expect_comments ( 1 ) . await ;
478
483
479
- tester. workflow_success ( tester. auto_branch ( ) ) . await ?;
480
- tester. process_merge_queue ( ) . await ;
481
- insta:: assert_snapshot!(
482
- tester. get_comment( ) . await ?,
483
- @r"
484
+ tester. process_merge_queue ( ) . await ;
485
+ tester. expect_comments ( 1 ) . await ;
486
+
487
+ tester. workflow_success ( tester. auto_branch ( ) ) . await ?;
488
+ tester. process_merge_queue ( ) . await ;
489
+ insta:: assert_snapshot!(
490
+ tester. get_comment( ) . await ?,
491
+ @r"
484
492
:sunny: Test successful - [Workflow1](https://github.com/workflows/Workflow1/1)
485
493
Approved by: `default-user`
486
494
Pushing merge-main-sha1-pr-1-sha-0 to `main`...
487
495
"
488
- ) ;
496
+ ) ;
489
497
490
- Ok ( tester)
491
- } )
492
- . await ;
498
+ Ok ( tester)
499
+ } )
500
+ . await ;
493
501
}
494
502
495
503
#[ sqlx:: test]
496
504
async fn auto_build_check_run_success ( pool : sqlx:: PgPool ) {
497
- run_test ( pool, |mut tester| async {
498
- tester. create_branch ( AUTO_BRANCH_NAME ) . expect_suites ( 1 ) ;
505
+ let github = GitHubState :: default ( ) . with_default_config (
506
+ r#"
507
+ merge_queue_enabled = true
508
+ "# ,
509
+ ) ;
499
510
500
- tester. post_comment ( "@bors r+" ) . await ?;
501
- tester. expect_comments ( 1 ) . await ;
511
+ BorsBuilder :: new ( pool)
512
+ . github ( github)
513
+ . run_test ( |mut tester| async {
514
+ tester. create_branch ( AUTO_BRANCH_NAME ) . expect_suites ( 1 ) ;
502
515
503
- tester. process_merge_queue ( ) . await ;
504
- tester. expect_comments ( 1 ) . await ;
516
+ tester. post_comment ( "@bors r+" ) . await ? ;
517
+ tester. expect_comments ( 1 ) . await ;
505
518
506
- tester. workflow_success ( tester. auto_branch ( ) ) . await ?;
507
- tester. process_merge_queue ( ) . await ;
508
- tester. expect_comments ( 1 ) . await ;
519
+ tester. process_merge_queue ( ) . await ;
520
+ tester. expect_comments ( 1 ) . await ;
509
521
510
- tester. expect_check_run (
511
- & tester. default_pr ( ) . await . get_gh_pr ( ) . head_sha ,
512
- AUTO_BUILD_CHECK_RUN_NAME ,
513
- AUTO_BUILD_CHECK_RUN_NAME ,
514
- CheckRunStatus :: Completed ,
515
- Some ( CheckRunConclusion :: Success ) ,
516
- ) ;
522
+ tester. workflow_success ( tester. auto_branch ( ) ) . await ?;
523
+ tester. process_merge_queue ( ) . await ;
524
+ tester. expect_comments ( 1 ) . await ;
517
525
518
- Ok ( tester)
519
- } )
520
- . await ;
526
+ tester. expect_check_run (
527
+ & tester. default_pr ( ) . await . get_gh_pr ( ) . head_sha ,
528
+ AUTO_BUILD_CHECK_RUN_NAME ,
529
+ AUTO_BUILD_CHECK_RUN_NAME ,
530
+ CheckRunStatus :: Completed ,
531
+ Some ( CheckRunConclusion :: Success ) ,
532
+ ) ;
533
+
534
+ Ok ( tester)
535
+ } )
536
+ . await ;
521
537
}
522
538
523
539
#[ sqlx:: test]
0 commit comments