Skip to main content
Testkube 2.10.0 is out! Granular Metrics, AI MCP improvements, Organization management, and much more. Read More

Basic Artillery Example

Below is a basic workflow for executing an Artillery test. 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 if needed.

  • The spec.content property defines the location of the GitHub project.
  • The spec.steps property defines a single step that runs the artillery command and uploads the JSON report as an artifact.
Basic Artillery Workflow
kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: artillery-sample
namespace: testkube
labels:
docs: example
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/artillery/artillery-smoke-test.yaml
container:
workingDir: /data/repo/test/artillery
steps:
- name: Run Artillery tests
run:
image: artilleryio/artillery:2.0.9
shell: |
mkdir -p /data/artifacts
/home/node/artillery/bin/run run artillery-smoke-test.yaml -o /data/artifacts/artillery-report.json
artifacts:
workingDir: /data/artifacts
paths:
- '*'

The workflow uses Artillery's -o option to write /data/artifacts/artillery-report.json. Testkube detects uploaded Artillery aggregate JSON reports as artillery.report and ingests counters, rates, summaries, and histograms as Granular Metrics.

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

The log output from the Artillery execution:

Artillery Log Output

Basic Artillery from Template

Below is an example workflow for executing the Artillery test using an official Testkube Template.

Basic Artillery Workflow from Template
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: artillery-sample-from-template
namespace: testkube
labels:
docs: example
spec:
container:
workingDir: /data/repo/test/artillery
steps:
- name: Run from template
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/artillery/artillery-smoke-test.yaml
workingDir: /data/repo/test/artillery
template:
name: official/artillery/v1
config:
version: 2.0.9
run: "mkdir -p /data/artifacts && artillery run artillery-smoke-test.yaml -o /data/artifacts/artillery-report.json"
artifacts:
workingDir: /data/artifacts
paths:
- '*'