Emitting Standard CDEvents
CDEvents is a common specification for Continuous Delivery events. Testkube is a proud supporter of this specification and we have added in the specification support for Testing Events to be release on v0.3.0 of the spec.
As of the 1.12 release, Testkube can emit standard CDEvents to a webhook endpoint. This can be used to integrate with any CD tool that supports the CDEvents standard.
As of Testkube 2.7.0, you need a Webhook Agent in your Testkube Environment to emit CDEvents - Read More
In 2.7.0, resources are stored in the Control Plane database. CDEvents for resource lifecycle (created, updated, deleted) are not emitted when workflows or other resources are created, updated, or deleted via the Control Plane (e.g. the dashboard). See the Changelog — v2.7.0 for details and the planned fix in the next monthly release.
Step 1 - Enable CDEvents
To enable CDEvents, you need to set the following Helm values:
helm upgrade \
--install \
--create-namespace \
--namespace testkube \
testkube \
oci://us-east1-docker.pkg.dev/testkube-cloud-372110/testkube/testkube --version <version> \
--set testkube-api.cdeventsTarget=https://YOUR_WEBHOOK_URL
For testing purposes you can use webhook.site to get a webhook URL.
Step 2 - Test Emitting CDEvents
To test emitting CDEvents, create a sample Test Workflow with Testkube and run it.
testkube create testworkflow -f EXAMPLE_FILE.yaml
testkube run testworkflow TEST_WORKFLOW_NAME -f
Check the webhook sink to see the CDEvent emitted by Testkube. An event like the following should have been emitted:
{
"context": {
"version": "0.2.0",
"id": "85e4cef0-e5bf-4bfd-9e62-5b227867b064",
"source": "cluster56c26628bece30eb07f01a64daaa3f27",
"type": "dev.cdevents.testcaserun.finished.0.1.0",
"timestamp": "2023-06-08T11:30:22.30535521Z"
},
"subject": {
"id": "test-cdevents-7",
"source": "cluster56c26628bece30eb07f01a64daaa3f27",
"type": "testCaseRun",
"content": {
"environment": {
"id": "testkube",
"source": "cluster56c26628bece30eb07f01a64daaa3f27"
},
"outcome": "pass",
"testCase": {
"id": "test-cdevents",
"type": "functional",
"uri": "/tests/executions/test-cdevents"
}
}
}
}
Reference
For more information about CDEvents, please visit the CDEvents website.
To know more about the Testing Events specification, please visit the Testing Events page.