Skip to main content
New to Testkube? Unleash the power of cloud native testing in Kubernetes with Testkube. Get Started >

Basic Chainsaw Example

Chainsaw is an open-source tool initially developed to define and run Kyverno end-to-end tests. It can test any Kubernetes objects.

Below is a simple workflow for executing a Chainsaw test available on GitHub. You can paste this directly into the YAML of an existing or new test, just make sure to update the name and namespace for your environment as needed.

  • The spec.content property defines the path to the Chainsaw test in a GitHub repository.
  • The spec.container property uses the official Chainsaw image to set up test environment.
  • The spec.steps property defines a single step that runs the chainsaw test <test path> test command.
Chainsaw Workflow
kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: simple-chainsaw-test
namespace: testkube
spec:
content:
git:
uri: https://github.com/cerebro1/chainsaw-testkube-demo.git
container:
image: ghcr.io/kyverno/chainsaw:latest
steps:
- name: Run test
shell: |
chainsaw test /data/repo/chainsaw-test/basic-test
status: {}

After execution, you can see the log output from the test executions under the executions panel tabs:

Chainsaw Log Output