</a>
Build integration and end-to-end tests in minutes, instead of days, using OpenTelemetry and trace-based testing.
</b>
Docs | Tutorials | Recipes | Examples | Discord | Blog | Website
</b>
Tracetest lets you build integration and end-to-end tests 98% faster with distributed traces.
No plumbing, no mocks, no fakes. Test against real data.
You can:
100ms
.0
.100ms
.Build tests in minutes.
Programmatically - in YAML
type: Test
spec:
id: Yg9sN-94g
name: Pokeshop - Import
description: Import a Pokemon
trigger:
type: http
httpRequest:
url: http://demo-api:8081/pokemon/import
method: POST
headers:
- key: Content-Type
value: application/json
body: '{"id":52}'
specs:
- name: 'All Database Spans: Processing time is less than 100ms'
selector: span[tracetest.span.type="database"]
assertions:
- attr:tracetest.span.duration < 100ms
Click on the image or this link to watch the "Tracetest Intro Video" video (< 2 minutes)
curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s
:gear: Read the CLI installation docs for more options and instructions.
tracetest server install
This command will launch an install wizard that automatically installs Tracetest and a sample Pokeshop Demo app into either Docker or Kubernetes based on your selection.
Or, install Tracetest with Helm. The Tracetest Helm charts are located here.
helm install tracetest kubeshop/tracetest --namespace=tracetest --create-namespace
:gear: Read the Server installation docs for more options and instructions.
Once you’ve installed Tracetest Server, access the Tracetest Web UI on http://localhost:11633
.
Check out the Opening Tracetest guide to start creating and running tests!
Once the test is built, it can be run automatically as part of a build process. Every test has a trace attached, allowing you to immediately see what worked, and what did not, reducing the need to reproduce the problem to see the underlying issue.
The Tracetest test definition files are written in a simple YAML format. You can write them directly or build them graphically via the UI. Here is an example of a test which:
POST
against the pokemon/import
endpoint.200
status code.50ms
.type: Test
spec:
id: 5dd03dda-fad2-49f0-b9d9-5143b746c1d0
name: DEMO Pokemon - Import - Import a Pokemon
description: "Import a pokemon"
# Configure how tracetest triggers the operation on your application
# triggers can be http, grpc, etc
trigger:
type: http
httpRequest:
method: POST
url: http://demo-pokemon-api.demo.svc.cluster.local/pokemon/import
headers:
- key: Content-Type
value: application/json
body: '{"id":52}'
# Definition of the test specs which is a combination of a selector
# and an assertion
specs:
# the selector defines which spans will be targeted by the assertions
selector: span[tracetest.span.type = "http"]
# the assertions define the checks to be run. In this case, all
# http spans will be checked for a status code = 200
- assertions:
- http.status_code = 200
# this next test ensures all the database spans execute in less
# than 50 ms
selector: span[tracetest.span.type = "database"]
- assertions:
- tracetest.span.duration < "50ms"
Save a test definition file above as pokeshop_import.yaml
. Use the CLI to run a test.
tracetest run test --file /path/to/pokeshop_import.yaml
Check out the CI/CD docs to learn more about test automation.
We strive to produce quality code and improve Tracetest rapidly and safely. Therefore, we have a full suite of both front-end and back-end tests. Cypress tests are running against the front-end code and (surprise, surprise) Tracetest against the back-end code. You can see the test runs here, and a blog post describing our testing pipelines here.
Have an idea to improve Tracetest?
You can:
Whether it’s big or small, we love contributions.
Not sure where to get started? You can :