testkube
testkube copied to clipboard
Triggering test based on cluster events
DoD:
Run test / test suites when resource change
We decided to go with TestTrigger CRD
apiVersion: tests.testkube.io/v1
kind: TestTrigger
metadata:
name: deployment-test-trigger
spec:
testName: someLoadTest
# or
#testSuiteName: someLoadTest
labels:
app: my-deployment
event: update
- watch based on
labels
on givenevent
- reconcile triggers in operator/watcher
- watcher should be put it into Testkube API
----------- EDIT ----------
we was also considering labels, but they are no flexible enough.
Resource should have testkube.io/v1 annotation
Option one: e.g.
labels:
testkube.io/v1/trigger-test/name: test-name
testkube.io/v1/trigger-test/variables: key=value,key2=value2
Should we integrate Mario's work https://github.com/lreimer/testkube-watch-controller?
This is one of the features I was trying to achieve with ArgoCD, enabling this will be a lifesaver.
Should we integrate Mario's work https://github.com/lreimer/testkube-watch-controller? Always happy to help on the integration work.
I prefer option 1) using labels, because it allows for more flexibility. Option 2) using the CRDs feels a bit rigid.
Maybe have a dedicated CRD such as TestTrigger
would allow for more flexibility?
apiVersion: tests.testkube.io/v1
kind: TestTrigger
metadata:
name: deployment-test-trigger
spec:
testName: someLoadTest
labels:
app: my-deployment
event: update
I like this idea of doing separate resources, labels feels limited a little bit
Are there any thoughts of enabling this with ArgoCD plugin?
This is finally implemented with this PR: https://github.com/kubeshop/testkube/pull/2445