@@ -341,7 +341,6 @@ handled during merge and rebase. This is normal, and you should still perform st
341341mod tests {
342342 use crate :: bors:: handlers:: trybuild:: { TRY_BRANCH_NAME , TRY_MERGE_BRANCH_NAME } ;
343343 use crate :: database:: operations:: get_all_workflows;
344- use crate :: database:: BuildStatus ;
345344 use crate :: github:: CommitSha ;
346345 use crate :: tests:: mocks:: {
347346 default_pr_number, default_repo_name, run_test, BorsBuilder , Comment , GitHubState , User ,
@@ -394,9 +393,9 @@ mod tests {
394393 tester
395394 . post_comment ( Comment :: from ( "@bors try" ) . with_author ( User :: unprivileged ( ) ) )
396395 . await ?;
397- assert_eq ! (
396+ insta :: assert_snapshot !(
398397 tester. get_comment( ) . await ?,
399- "@unprivileged-user: :key: Insufficient privileges: not in try users"
398+ @ "@unprivileged-user: :key: Insufficient privileges: not in try users"
400399 ) ;
401400 Ok ( tester)
402401 } )
@@ -409,9 +408,9 @@ mod tests {
409408 tester
410409 . post_comment ( Comment :: from ( "@bors try" ) . with_author ( User :: try_user ( ) ) )
411410 . await ?;
412- assert_eq ! (
411+ insta :: assert_snapshot !(
413412 tester. get_comment( ) . await ?,
414- ":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…"
413+ @ ":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…"
415414 ) ;
416415 Ok ( tester)
417416 } )
@@ -422,9 +421,9 @@ mod tests {
422421 async fn try_merge_comment ( pool : sqlx:: PgPool ) {
423422 run_test ( pool, |mut tester| async {
424423 tester. post_comment ( "@bors try" ) . await ?;
425- assert_eq ! (
424+ insta :: assert_snapshot !(
426425 tester. get_comment( ) . await ?,
427- ":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…"
426+ @ ":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…"
428427 ) ;
429428 Ok ( tester)
430429 } )
@@ -674,8 +673,8 @@ mod tests {
674673 tester. expect_comments ( 1 ) . await ;
675674 tester. post_comment ( "@bors try cancel" ) . await ?;
676675 tester. expect_comments ( 1 ) . await ;
677- let pr = tester . default_pr_db ( ) . await ? . unwrap ( ) ;
678- assert_eq ! ( pr . try_build . unwrap ( ) . status , BuildStatus :: Cancelled ) ;
676+
677+ tester . default_pr ( ) . await . expect_try_build_cancelled ( ) ;
679678 Ok ( tester)
680679 } )
681680 . await ;
@@ -744,15 +743,11 @@ mod tests {
744743
745744 #[ sqlx:: test]
746745 async fn try_build_start_modify_labels ( pool : sqlx:: PgPool ) {
747- let gh = GitHubState :: default ( ) ;
748- gh. default_repo ( ) . lock ( ) . set_config (
749- r#"
746+ BorsBuilder :: new ( pool)
747+ . github ( GitHubState :: default ( ) . with_default_config ( r#"
750748[labels]
751749try = ["+foo", "+bar", "-baz"]
752- "# ,
753- ) ;
754- BorsBuilder :: new ( pool)
755- . github ( gh)
750+ "# ) )
756751 . run_test ( |mut tester| async {
757752 tester. post_comment ( "@bors try" ) . await ?;
758753 insta:: assert_snapshot!( tester. get_comment( ) . await ?, @":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…" ) ;
@@ -767,15 +762,11 @@ try = ["+foo", "+bar", "-baz"]
767762
768763 #[ sqlx:: test]
769764 async fn try_build_succeeded_modify_labels ( pool : sqlx:: PgPool ) {
770- let gh = GitHubState :: default ( ) ;
771- gh. default_repo ( ) . lock ( ) . set_config (
772- r#"
765+ BorsBuilder :: new ( pool)
766+ . github ( GitHubState :: default ( ) . with_default_config ( r#"
773767[labels]
774768try_succeed = ["+foo", "+bar", "-baz"]
775- "# ,
776- ) ;
777- BorsBuilder :: new ( pool)
778- . github ( gh)
769+ "# ) )
779770 . run_test ( |mut tester| async {
780771 tester. post_comment ( "@bors try" ) . await ?;
781772 insta:: assert_snapshot!( tester. get_comment( ) . await ?, @":hourglass: Trying commit pr-1-sha with merge merge-main-sha1-pr-1-sha-0…" ) ;
@@ -795,15 +786,11 @@ try_succeed = ["+foo", "+bar", "-baz"]
795786
796787 #[ sqlx:: test]
797788 async fn try_build_failed_modify_labels ( pool : sqlx:: PgPool ) {
798- let gh = GitHubState :: default ( ) ;
799- gh. default_repo ( ) . lock ( ) . set_config (
800- r#"
789+ BorsBuilder :: new ( pool)
790+ . github ( GitHubState :: default ( ) . with_default_config ( r#"
801791[labels]
802792try_failed = ["+foo", "+bar", "-baz"]
803- "# ,
804- ) ;
805- BorsBuilder :: new ( pool)
806- . github ( gh)
793+ "# ) )
807794 . run_test ( |mut tester| async {
808795 tester. create_branch ( TRY_BRANCH_NAME ) . expect_suites ( 1 ) ;
809796 tester. post_comment ( "@bors try" ) . await ?;
0 commit comments