• Stars
    star
    1,021
  • Rank 45,070 (Top 0.9 %)
  • Language
    Go
  • License
    Other
  • Created almost 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Tracetest Logo


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

Get Started! Β πŸ‘‰Β 

DocsΒ |Β  TutorialsΒ |Β  RecipesΒ |Β  ExamplesΒ |Β  DiscordΒ |Β  BlogΒ |Β  Website

Tracetest is released under the MIT License PRs welcome! Help us reach 1k stars! Join our Community! Talk to us on Discord! Tracetest Twitter

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:

  • Assert against both the response and trace data at every point of a request transaction.
  • Assert on the timing of trace spans.
    • Eg. A database span executes within 100ms.
  • Wildcard assertions across common types of activities.
    • Eg. All gRPC return codes should be 0.
    • Eg. All database calls should happen in less than 100ms.
  • Assert against side-effects in your distributed system.
    • Eg. Message queues, async API calls, external APIs, etc.
  • Integrate with your existing distributed tracing solution.
  • Define multiple test triggers:
    • HTTP requests
    • gRPC requests
    • Trace IDs
    • and many more...
  • Save and run tests manually and via CI build jobs.
  • Verify and analyze the quality of your OpenTelemetry instrumentation to enforce rules and standards.
  • Test long-running processes.

Build tests in minutes.

  • Visually - in the Web UI

  • 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

πŸ”₯ Features

  • Works out of the box with your existing OpenTelemetry instrumentation, supporting numerous trace data stores, including:
    • Jeager
    • Grafana Tempo
    • OpenSearch
    • Elastic
    • And, many more...
    • Tell us which other trace data stores you want supported!
  • Works out of the box by adding Tracetest as an additional pipeline via your OpenTelemetry Collector config.
  • Supporting multiple ways of creating a test, including HTTP, GRPC and Postman Collections.
  • Visualize the changes you are making to your trace as you develop, enabling Observability-Driven Development.
  • Add assertions based on response data from the trigger request and all trace data contained in the spans of your distributed trace.
  • Specify which spans to check in assertions via the selector language.
  • Define checks against the attributes in these spans, including properties, return status, or timing.
  • Create tests visually in the Tracetest Web UI or programatically via YAML-based test definition files.
  • Use test definition files and the Tracetest CLI to enable Gitops flows and CI/CD automation.
  • Tracetest CLI allows importing & exporting tests, running tests, and more.
  • Version tests as the definition of the test is altered.
  • The guided install can include an example "Pokeshop" microservice that is instrumented with OpenTelemetry to use as an example application under test.
  • Create environment variables to assert the same behavior across multiple environments (dev, staging, and production, for example)
  • Create test outputs by defining a variable based on the information contained in a particular span's attributes.
  • Run ad-hoc tests by using undefined variables to enable supplying variables at runtime.
  • Define test suites/transactions to chain tests together and use variables obtained from a test in a subsequent test. These variables can also be loaded from the environment.
  • Run comprehensive trace analysis and validation to adhere to OpenTelemetry rules and standards.
  • Configure test runner behavior with required gates used when executing your tests to determine whether to mark the test as passed or failed.

πŸš€ Getting Started

Click on the image or this link to watch the "Tracetest Intro Video" video (< 2 minutes)

1️⃣ Install the Tracetest CLI

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

βš™οΈ Read the CLI installation docs for more options and instructions.

2️⃣ Install the Tracetest Server

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

βš™οΈ Read the Server installation docs for more options and instructions.

3️⃣ Open Tracetest

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!

πŸ€” 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 in the Tracetest Web 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 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"

πŸ€– How to run an automated test?

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.

πŸ§ͺ Tests

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.

🎀 Feedback

Have an idea to improve Tracetest?

You can:

🌱 Contributing & Community

Whether it's big or small, we love contributions.

Not sure where to get started? You can:

More Repositories

1

botkube

An app that helps you monitor your Kubernetes cluster, debug critical deployments & gives recommendations for standard practices
Go
2,109
star
2

monokle

🧐 Monokle Desktop empowers you to better create, understand, and deploy YAML manifests with a visual UI that also provides policy validation and cluster insights.
TypeScript
1,397
star
3

testkube

☸️ Kubernetes-native testing framework for test execution and orchestration
Go
1,342
star
4

kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
Go
260
star
5

kusk-gen

Kusk Gen generates Ingress-controller configurations from your OpenAPI definition
Go
173
star
6

testkube-dashboard

Dashboard for viewing real-time TestKube results (deprecated)
TypeScript
28
star
7

helm-charts

Kubeshop Helm Repository
Smarty
24
star
8

monokle-core

Monokle validation engine, CLI and shared UI components
TypeScript
17
star
9

pokeshop

TypeScript
15
star
10

kusk-examples

This repository contains examples of how to run applications with Kusk Gateway
TypeScript
13
star
11

testkube-executor-k6

TestKube executor for K6
Go
12
star
12

kusk-gateway-dashboard

Dashboard for managing Kusk-Gateway
TypeScript
11
star
13

monokle-cli

CLI for Monokle core validation library
TypeScript
10
star
14

testkube-argocd

Devops guide and assets to use Testkube for ArgoCD
Shell
10
star
15

xk6-tracetest

Go
9
star
16

monokle-admission-controller

Kubernetes Admission Controller for enforcing policies in your clusters
TypeScript
8
star
17

botkube-docs

Docs for botkube.io
MDX
8
star
18

monokle-demo

🀠 Sample Kubernetes resources to interactively explore Monokle.
Mustache
8
star
19

testkube-operator

Testkube Operators for managing CustomResources
Go
8
star
20

kusk

CLI for Kusk Gateway related functionality
Go
7
star
21

testkube-executor-template

Executors basic template for new Testkube executor
Go
5
star
22

testkube-executor-cypress

Testkube Cypress Executor
Go
5
star
23

testkube-docker-action

Testkube Docker Github action
Dockerfile
5
star
24

testkube-executor-tracetest

TestKube executor for Tracetest
Go
5
star
25

testkube-executor-postman

Go
5
star
26

monokle-default-templates-plugin

Default templates included with Monokle
5
star
27

vscode-monokle

An extension for Visual Studio Code to validate your Kubernetes configuration
TypeScript
5
star
28

testkube-executor-maven

Testkube executor for Maven
Go
4
star
29

monokle-community-plugins

A home for all the community plugins of Monokle
TypeScript
4
star
30

monokle-templates

Smarty
4
star
31

testkube-run-action

GitHub Action to trigger tests on Testkube instances
TypeScript
4
star
32

testkube-NAKubecon22-FreePlushie

Code for KubeCon NA 2022 - for free Testkube Plushies giveaway!
4
star
33

botkube-plugins-template

Quick start repository for creating Botkube executor and source plugins
Go
4
star
34

testkube-executor-kubepug

kubepug executor for Testkube
Go
4
star
35

monokle-action

Run this GitHub action to validate your Kubernetes resources with the Monokle SARIF validator.
TypeScript
3
star
36

tracetest-agent-action

Start a Tracetest agent to run trace based tests
3
star
37

testkube-executor-keptn

Go
3
star
38

homebrew-monokle

Homebrew taps for Kubeshop
Ruby
3
star
39

nordictestingdays-2022

Contents for workshop held at NordicTestingDays 2022 conference in Tallinn
JavaScript
3
star
40

monokle-chrome-extension

Integrates actions for discovering and exploring Kubernetes resources with Monokle Cloud into the GitHub User Interface
JavaScript
3
star
41

setup-testkube

GitHub Action to set up the Testkube CLI
TypeScript
2
star
42

testkube-executor-zap

ZAP based security tests executor for Testkube
Go
2
star
43

testkube-executor-soapui

Testkube Executor for SoapUI
Go
2
star
44

tracetest-github-action

GitHub Action for running trace-based tests against Tracetest with our CI/CD pipeline
2
star
45

kuskgateway-api-server

REST API used by the Kusk Dashboard
Go
2
star
46

testkube-executor-gradle

Testkube executor for gradle
Go
2
star
47

kusk-vscode

Kusk extension for Visual Studio Code
TypeScript
2
star
48

testkube-flux

Devops guide and assets to use Testkube with Flux
JavaScript
2
star
49

testkube-executor-example-nodejs

NodeJS example executor
JavaScript
2
star
50

petshop-kusk-cicd

Sample repo for continuous deployment of an OpenAPI definition with SwaggerHub and Kusk Gateway
2
star
51

homebrew-testkube-dev

Ruby
2
star
52

testkube-executor-curl

This repo shows how to make a simple executor with curl commands.
Go
1
star
53

homebrew-testkube

Homebrew taps for Kubeshop
Ruby
1
star
54

kubtest-executor-k8sjobs

Go
1
star
55

.github

Community documents
1
star
56

testkube-executor-artillery

Artillery.io Testkube Executor
Go
1
star
57

testkube-executor-init

Testkube executor init container
Go
1
star
58

testkube-executor-playwright

Testkube Playwright Executor
Go
1
star
59

testkube-executor-example

Go
1
star
60

testkube-ginkgo-example

Testkube example test for Ginkgo
Go
1
star
61

kubeshop.github.io

kubeshop.github.io
HTML
1
star
62

homebrew-kusk

Ruby
1
star
63

homebrew-tracetest

Ruby
1
star
64

testkube-executor-ginkgo

Testkube Ginkgo executor
Go
1
star
65

testkube-cloud-action

GitHub action to run Testkube commands on a managed cluster equipped with Testkube
1
star
66

testkube-examples

Examples for Testkube
Java
1
star