testkube
testkube copied to clipboard
Allow webhooks to run on given Test/Testsuite only
Describe the enhancement you'd like to see
As a tester, I want to send webhook requests only for given Test/TestSuite execution events
WH1 (start,end) = Test1
WH2 (start) = Test2
WH3 (start) = "" test -> *
now:
Notify(start Test1) -> WH1 WH2 WH3
want:
Notify(start Test1) -> WH1 WH3
cc: @TheBrunoLopes @geowalrus4gh
- Let's use test and test suite labels to filter which events will be sent by a certain webhook. Example of user scenario: User defines 1 or more tests with a certain label, after that he will define a webhook stating that for all the tests with a certain label, listen to "end-events" and send them to a specific URL.
cc: @exu @sweetca
One thing to note, that labels can be used for different purposes, this way we will create an implicit link between tests and webhooks. For example, if user add ssome lables to just separate resource projects project=payment_gateway
for all resources in same project, then all tests in this project will always use this webhook
I was originally thought about having explicit dependcy: We will add a webhook type to webhook: broadcasting and targeted For each test you will be able to list a set of targeted webhooks If the test is not linked to wehbooks, then notification are sent to all broadcasting webhooks If the test is linked to trageted webhooks, then notifications are sent to them
Check a few uses cases:
- If we added a label to test, does it mean that it can only use a webhook for notifications wth the same label?
- If we added a label to webhook, does it mean that it can only send notifications for tests with the same label?
- If we want to have boardcast notifications, does it mean, that both webhook and test should not have any label?
- If test has labels app=testkube,type=backend and one webhook has labels app=testkube,type=backend,service=checkout and other webhook has label app=testkube. what should happen?