-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug running multiple triggers #388
Conversation
Fixes tektoncd#387 This PR fixes a pointer bug where an EventListener with `n` triggers would have the last trigger execute `n` times instead of all `n` triggers executing once. This PR also updates the TestHandleEvent function to test multiple triggers. In the future, it might be worth refactoring the TestHandleEvent function into a testing table, so we can increase our test coverage.
@@ -131,8 +146,11 @@ func TestHandleEvent(t *testing.T) { | |||
if _, err := triggersClient.TektonV1alpha1().TriggerTemplates(namespace).Create(tt); err != nil { | |||
t.Fatalf("Error creating TriggerTemplate: %s", err) | |||
} | |||
if _, err := triggersClient.TektonV1alpha1().TriggerBindings(namespace).Create(tb); err != nil { | |||
t.Fatalf("Error creating TriggerBinding: %s", err) | |||
// for _, tb := range []*triggersv1.TriggerBinding{tb, tb2, tb3} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
}, | ||
}, | ||
} | ||
// var wantResources []pipelinev1.PipelineResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
}, | ||
}, | ||
} | ||
// var wantResources []pipelinev1.PipelineResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom, wlynch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sorry, I forgot to clean up those comments. I created a PR to clean it up here: #389 |
Changes
Fixes #387
This PR fixes a pointer bug where an EventListener with
n
triggerswould have the last trigger execute
n
times instead of alln
triggers executing once.
This PR also updates the TestHandleEvent function to test multiple
triggers. In the future, it might be worth refactoring the
TestHandleEvent function into a testing table, so we can increase our
test coverage.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.