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

Testkube Quickstart

In this tutorial you will learn how to install Testkube, run your first Test Workflow, inspect its executions, and integrate it with your CI/CD pipeline(s).

1. Install or Sign in to Testkube

Testkube has flexibility in its deployments (learn more at deployment architectures).

  • Testkube On-Prem runs both the Control Plane and Test Execution Agents in your infrastructure.
  • Testkube Cloud runs the Control Plane in our cloud and the Test Execution Agents in your infrastructure.
  1. Sign in to Testkube Cloud.
  2. Click on the Let's get started button.
  3. Enter an environment name and click Create environment.
  4. Run the generated testkube pro init command in your terminal to install the Testkube Agent.

You will now see the Testkube Dashboard for your new environment:

The dashboard

info

Looking for more installation details or customization? You can learn more in our installation documentation.

2. Define your First Test Workflow

Let's take a look at a K6 load test to familiarize ourselves with Testkube's Workflows:

# The workflow is a Kubernetes CRD with the usual apiVersion, kind and metadata.
# It configures the steps for your test automation pipeline.
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
# The workflow will have a name that you define here.
name: my-test
# By default, workflows should be applied to the namespace of the Testkube agent.
namespace: testkube
# Labels allow you to filter and group within the Dashboard and CLI.
labels:
app.kubernetes.io/name: my-api
app.kubernetes.io/part-of: my-cms
testkube.io/test-tool: k6s
testkube.io/test-category: load-test
spec:
# The content property allows you to fetch your test cases and source code.
# You can check out content from Git or create specific files from strings.
# In this case, we'll go for an inline test for simplicity.
content:
files:
- path: k6.js
content: |
import http from "k6/http";
import {
textSummary,
jUnit,
} from "https://jslib.k6.io/k6-summary/0.0.2/index.js";

export const options = {
thresholds: {
http_req_failed: ["rate<0.01"],
},
};
export default function () {
http.get("http://test.k6.io");
}
export function handleSummary(data) {
return {
stdout: textSummary(data, { indent: " ", enableColors: true }),
"junit.xml": jUnit(data),
};
}
# Workflows default to the container image's working directory. Often you will want
# to update this to the directory of your content, but be mindful as some testing
# tools might malfunction when their container's working directory is changed.
# Git content is put in `/data/repo`, whereas relative file content in `/data`.
container:
workingDir: /data
# Steps are the main building blocks in workflows. Each step is executed in sequential order.
# You can use steps to setup or teardown your testing tool and test dependencies.
steps:
# Each step can run with their own image, yet the file system is shared across steps.
# In this case, we'll run K6 on our test defined above.
- name: Run k6 tests
run:
image: grafana/k6:latest
shell: k6 run k6.js --iterations 100
# Logs of steps are automatically stored whereas artifacts will require an explicit step.
# You can give us the location of the artifacts and Testkube takes care of the rest.
- name: Saving artifacts
artifacts:
paths: ["junit.xml"]

While this only scratches the surface of Workflows, we can now attempt to run this Workflow. You can learn more about how to create and run you Workflows in the next steps.

info

Learn more about Workflows functionality and configuration in the Workflow Documentation.

3. Run your Test Workflow

  1. Choose "Import from YAML" in the Workflow Wizard
  2. Copy and paste the Test Workflow above.
  3. Click the Create button.
  4. View the status and logs of the Workflow as it is executing.
tip

Alternatively, you can use the "Create from Wizard" option in the Workflow Wizard to create your own Test Workflow from scratch leveraging Test Workflow Templates for a variety of tools such as K6, Postman, Artillery, Cypress, Playwright and more.

4. Looking at Past Executions

  1. Go to the Dashboard and open your recent execution.
  2. You can see this execution's logs right away.
  3. View the execution's artifacts by going to the Artifacts tab.
  4. Click the download icon to download it.

A past execution

5. Integrate with your CI/CD Pipelines

Testkube Workflow execution can easily be integrated in your CI pipelines, run on a cron schedule or trigger on a Kubernetes event. For example, if I want to run this test every time my deployment's image updates.

  1. Browse to your Test Workflow within the Dashboard - Read More.
  2. Click the CI/CD Integrations tab under your Workflow Details.
  3. You can see the instructions where all variables have been prefilled for you.
  4. Follow these instructions to run it on your favourite provider.
tip

Testkube currently shows instructions for GitHub Actions, GitLab CI, CircleCI, Jenkins, Azure DevOps, Tekton and ArgoCD, but can be integrated into any CI/CD pipeline by automating the Testkube CLI or the Testkube API.

Read more about Testkube Integrations

Next steps

Congratulations on running your first Test Workflow!

At this point you should have installed Testkube, run a sample test and integrated that within your pipeline. Our recommended next step is to write run one of your own tests within Testkube.

To learn how to do this we recommend you either:

tip

Don't hesitate to reach out for help on our Slack Community or by Getting in touch.