@@ -3755,7 +3755,7 @@ void foo() {
37553755 });
37563756
37573757 test (
3758- 'opened PR with adds CICD label and schedules tests if author is member of flutter-hackers' ,
3758+ 'opened PR with adds CICD label if author is member of flutter-hackers' ,
37593759 () async {
37603760 tester.message = generateGithubWebhookMessage (
37613761 action: 'opened' ,
@@ -3766,8 +3766,7 @@ void foo() {
37663766
37673767 verify (
37683768 issuesService.addLabelsToIssue (Config .flutterSlug, 123 , ['CICD' ]),
3769- ).called (1 );
3770- expect (scheduler.triggerPresubmitTargetsCnt, 1 );
3769+ );
37713770 },
37723771 );
37733772 test (
@@ -3862,87 +3861,50 @@ void foo() {
38623861 );
38633862
38643863 test (
3865- 'synchronize event by non-privileged user removes CICD label and creates awaiting checkrun ' ,
3864+ 'synchronize event with CICD label does not schedules tests ' ,
38663865 () async {
3867- githubService.checkRunsMock = '{"total_count": 0, "check_runs": [{}]}' ;
38683866 tester.message = generateGithubWebhookMessage (
38693867 action: 'synchronize' ,
38703868 withCicdLabel: true ,
38713869 );
38723870
38733871 await tester.post (webhook);
3874-
3875- expect (githubService.removedLabels, [
3876- (Config .flutterSlug, 123 , Config .kCicdLabel),
3877- ]);
3878- verify (
3879- mockGithubChecksUtil.createCheckRun (
3880- any,
3881- any,
3882- any,
3883- 'Awaiting CICD label' ,
3884- output: anyNamed ('output' ),
3885- ),
3886- ).called (1 );
38873872 expect (scheduler.triggerPresubmitTargetsCnt, 0 );
38883873 },
38893874 );
38903875
38913876 test (
3892- 'synchronize event by non-privileged user without label creates awaiting checkrun ' ,
3877+ 'synchronize event adds CICD label if author is member of flutter-hackers ' ,
38933878 () async {
3894- githubService.checkRunsMock = '{"total_count": 0, "check_runs": [{}]}' ;
38953879 tester.message = generateGithubWebhookMessage (
38963880 action: 'synchronize' ,
3897- withCicdLabel : false ,
3881+ login : 'test-flutter-hacker' ,
38983882 );
38993883
39003884 await tester.post (webhook);
3901-
39023885 verify (
3903- mockGithubChecksUtil.createCheckRun (
3904- any,
3905- any,
3906- any,
3907- 'Awaiting CICD label' ,
3908- output: anyNamed ('output' ),
3909- ),
3910- ).called (1 );
3911- expect (scheduler.triggerPresubmitTargetsCnt, 0 );
3886+ issuesService.addLabelsToIssue (Config .flutterSlug, 123 , ['CICD' ]),
3887+ );
39123888 },
39133889 );
3914-
39153890 test (
3916- 'synchronize event by privileged user with label schedules tests ' ,
3891+ 'synchronize event does not add CICD label if author is not member of flutter-hackers ' ,
39173892 () async {
3918- tester.message = generateGithubWebhookMessage (
3919- action: 'synchronize' ,
3920- login: 'test-flutter-hacker' ,
3921- withCicdLabel: true ,
3922- );
3893+ tester.message = generateGithubWebhookMessage (action: 'synchronize' );
39233894
39243895 await tester.post (webhook);
3925-
3926- expect (scheduler.triggerPresubmitTargetsCnt, 1 );
39273896 verifyNever (
3928- mockGithubChecksUtil.createCheckRun (
3929- any,
3930- any,
3931- any,
3932- 'Awaiting CICD label' ,
3933- output: anyNamed ('output' ),
3934- ),
3897+ issuesService.addLabelsToIssue (Config .flutterSlug, 123 , any),
39353898 );
39363899 },
39373900 );
39383901
39393902 test (
3940- 'synchronize event by privileged user without label creates awaiting checkrun' ,
3903+ 'opened PR without CICD label creates "Awaiting CICD label" checkrun' ,
39413904 () async {
39423905 githubService.checkRunsMock = '{"total_count": 0, "check_runs": [{}]}' ;
39433906 tester.message = generateGithubWebhookMessage (
3944- action: 'synchronize' ,
3945- login: 'test-flutter-hacker' ,
3907+ action: 'opened' ,
39463908 withCicdLabel: false ,
39473909 );
39483910
@@ -3957,17 +3919,16 @@ void foo() {
39573919 output: anyNamed ('output' ),
39583920 ),
39593921 ).called (1 );
3960- expect (scheduler.triggerPresubmitTargetsCnt, 0 );
39613922 },
39623923 );
39633924
39643925 test (
3965- 'opened PR without CICD label creates "Awaiting CICD label" checkrun' ,
3926+ 'opened PR with CICD label STILL creates "Awaiting CICD label" checkrun if not exists ' ,
39663927 () async {
39673928 githubService.checkRunsMock = '{"total_count": 0, "check_runs": [{}]}' ;
39683929 tester.message = generateGithubWebhookMessage (
39693930 action: 'opened' ,
3970- withCicdLabel: false ,
3931+ withCicdLabel: true ,
39713932 );
39723933
39733934 await tester.post (webhook);
@@ -3985,12 +3946,12 @@ void foo() {
39853946 );
39863947
39873948 test (
3988- 'opened PR with CICD label STILL creates "Awaiting CICD label" checkrun if not exists' ,
3949+ 'edited PR without CICD label creates "Awaiting CICD label" checkrun if not exists' ,
39893950 () async {
39903951 githubService.checkRunsMock = '{"total_count": 0, "check_runs": [{}]}' ;
39913952 tester.message = generateGithubWebhookMessage (
3992- action: 'opened ' ,
3993- withCicdLabel: true ,
3953+ action: 'edited ' ,
3954+ withCicdLabel: false ,
39943955 );
39953956
39963957 await tester.post (webhook);
0 commit comments