Skip to content

🔭 Tracetest - Build integration and end-to-end tests in minutes, instead of days, using OpenTelemetry and trace-based testing.

License

Notifications You must be signed in to change notification settings

kubeshop/tracetest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracetest Logo Light Tracetest Logo Dark

End-to-end tests powered by OpenTelemetry. For QA, Dev, & Ops.

Install |  Documentation |  Twitter |  Discord |  Blog

Click on the image or this link to watch the "Tracetest Intro Video" video (7 mins)

Tracetest

Tracetest is a trace-based testing tool that leverages the data contained in your distributed traces to produce easy to create, yet super powerful integration tests. You can verify activity deep inside your system by asserting on data and flow information contained in the OpenTelemetry traces and span attributes. This can include:

  • testing events that occur on 'the other side' of an async message queue, even though the original async call has returned earlier.
  • assertions based on the timing of different steps in your process.
  • wildcard assertions across common types of activities, ie all gRPC return codes should be 0, all database calls should happen in less than 100ms.
  • test long running processes instrumented with OpenTelemetry tracing to assert proper operation deep in the process.
  • verify the quality of your OpenTelemetry instrumentation and enforce standards.

Features

Getting Started

You can install tracetest by running:

curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/setup.sh | bash -s

⚙️ To customize your Tracetest installation. Go to our installation guide for more information.

Installation only takes a few minutes and is done with via a Helm command. After installing, take a look at the Accessing the Dashboard guide to access the Tracetest Dashboard and create and run your first test.

How does Tracetest work?

  1. Pick an endpoint to test.
  2. Run a test, and get the trace.
  3. The trace is the blueprint of your system under test. It shows all the steps the system has taken to execute the request.
  4. Use this blueprint to define assertions through Tracetest UI.
  5. Add assertions on different services, checking return statuses, data, or even execution times of a system.
  6. Run the 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.

What does the test definition file look like?

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:

  • executes POST against the pokemon/import endpoint.
  • verifies that the HTTP blocks return a 200 status code.
  • verifies all database calls execute in less than 200ms.
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
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}'

# Setup what will be asserted on the resulting trace
testDefinition:
    selector: span[tracetest.span.type = "http"]
    - assertions:
        - http.status_code = 200
    selector: span[tracetest.span.type = "database"]
    - assertions:
        - tracetest.span.duration < "50ms"

Feedback

We are in the our early days with the project and need your help. Have an idea to improve it? Please Create an issue here or join our community on Discord.

Follow us on Twitter at @tracetest_io for updates

Give us a star on Github if you're interested in the project!

Documentation

Is available at https://kubeshop.github.io/tracetest

Tests

We strive to produce quality code and improve Tracetest rapidly and safely. Therefore, we have a full suite of both frontend and backend tests. We are using Cypress to test our frontend code and (surprise, surprise) Tracetest for our backend code. You can see the test runs here, and a blog post describing our testing pipelines here.

License

MIT License