File tree Expand file tree Collapse file tree 3 files changed +0
-56
lines changed Expand file tree Collapse file tree 3 files changed +0
-56
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,6 @@ func IsOkToTestComment(comment string) bool {
88
88
return oktotestRegex .MatchString (comment )
89
89
}
90
90
91
- func IsCancelComment (comment string ) bool {
92
- return cancelAllRegex .MatchString (comment ) || cancelSingleRegex .MatchString (comment )
93
- }
94
-
95
91
// EventTypeBackwardCompat handle the backward compatibility we need to keep until
96
92
// we have done the deprecated notice
97
93
//
Original file line number Diff line number Diff line change @@ -320,57 +320,6 @@ func TestIsOkToTestComment(t *testing.T) {
320
320
}
321
321
}
322
322
323
- func TestCancelComment (t * testing.T ) {
324
- tests := []struct {
325
- name string
326
- comment string
327
- want bool
328
- }{
329
- {
330
- name : "valid" ,
331
- comment : "/cancel" ,
332
- want : true ,
333
- },
334
- {
335
- name : "valid with some string before" ,
336
- comment : "/lgtm \n /cancel" ,
337
- want : true ,
338
- },
339
- {
340
- name : "valid with some string before and after" ,
341
- comment : "hi, trigger the ci \n /cancel \n then report the status back" ,
342
- want : true ,
343
- },
344
- {
345
- name : "valid comments" ,
346
- comment : "/lgtm \n /cancel \n /approve" ,
347
- want : true ,
348
- },
349
- {
350
- name : "invalid" ,
351
- comment : "/ok" ,
352
- want : false ,
353
- },
354
- {
355
- name : "invalid comment" ,
356
- comment : "/ok-to-test abc" ,
357
- want : false ,
358
- },
359
- {
360
- name : "cancel single pr" ,
361
- comment : "/cancel abc" ,
362
- want : true ,
363
- },
364
- }
365
-
366
- for _ , tt := range tests {
367
- t .Run (tt .name , func (t * testing.T ) {
368
- got := IsCancelComment (tt .comment )
369
- assert .Equal (t , tt .want , got )
370
- })
371
- }
372
- }
373
-
374
323
func TestIsTestRetestComment (t * testing.T ) {
375
324
tests := []struct {
376
325
name string
Original file line number Diff line number Diff line change @@ -525,7 +525,6 @@ func (v *Provider) handleCommitCommentEvent(ctx context.Context, event *github.C
525
525
err error
526
526
)
527
527
528
- // TODO: reuse the code from opscomments
529
528
// If it is a /test or /retest comment with pipelinerun name figure out the pipelinerun name
530
529
if provider .IsTestRetestComment (event .GetComment ().GetBody ()) {
531
530
prName , branchName , err = provider .GetPipelineRunAndBranchNameFromTestComment (event .GetComment ().GetBody ())
You can’t perform that action at this time.
0 commit comments