Test templates

When you write an integration or end-to-end test, you write specific instructions for your system – do A, do B, assert C – then verify that the output matches your expectation. You can run specific scenarios like this in Antithesis, or you can provide a single test template which Antithesis will use to generate hundreds or thousands of such scenarios.

What is a test template?

A test template is a collection of one or more compatible scripts that Antithesis uses to exercise parts of your system under faults.

When you run a test, Antithesis uses the test templates you provide to generate different scenarios by running your scripts in different orders, with different degrees of parallelism, under different fault conditions.

You should think of the test template as a client for your system – with the important distinction that the test template will also check your system’s behavior.

The individual scripts in a test template are called test commands. Antithesis handles all scheduling and selection of commands to run.

This has two important implications:

  1. A single test template containing a handful of test commands can produce thousands of meaningful test scenarios.
  2. The more granular the test commands in the test template are, the more effective Antithesis will be, because it has more options for steering your system.

This section explains how test templates work and the Antithesis convention for writing them:

  • Introduction
  • How Antithesis works
  • Using Antithesis with AI
  • Get started
  • Test an example system
  • With Docker Compose
  • Build and run an etcd cluster
  • Add a test template
  • With Kubernetes
  • Build and run an etcd cluster
  • Add a test template
  • Setup guide
  • For Docker Compose users
  • For Kubernetes users
  • Product
  • Test templates
  • Creating test templates
  • Test commands
  • How to check a test template locally
  • How to port tests to Antithesis
  • Test launchers
  • Reports
  • The triage reports
  • Findings
  • Environment
  • Utilization
  • Properties
  • The bug reports
  • Context, Instance, & Logs
  • Bug likelihood over time
  • Logs Explorer & multiverse map
  • Debugging
  • Multiverse debugging
  • Advanced mode
  • The Antithesis multiverse
  • Querying with event sets
  • Environment utilities
  • Using the Antithesis Notebook
  • Cookbook
  • Tooling integrations
  • CI integration
  • Discord and Slack integrations
  • Issue tracker integration - BETA
  • Configuration
  • Access and authentication
  • The Antithesis environment
  • Best practices
  • Docker best practices
  • Kubernetes best practices
  • Optimizing for testing
  • Concepts
  • Properties and Assertions
  • Properties in Antithesis
  • Assertions in Antithesis
  • Sometimes Assertions
  • Properties to test for
  • Fault injection
  • Reference
  • Webhooks
  • Launching a test
  • Launching a debugging session
  • Webhook parameters
  • SDK reference
  • Define test properties
  • Generate randomness
  • Manage test lifecycle
  • Assertion catalog
  • Coverage instrumentation
  • Go
  • Instrumentor
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Java
  • Using the SDK
  • Building your software
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • C
  • C++
  • C/C++ Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • JavaScript
  • Python
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Rust
  • Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • .NET
  • Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Languages not listed above
  • Assert (reference)
  • Lifecycle (reference)
  • Assertion Schema
  • Handling external dependencies
  • FAQ
  • Product FAQs
  • About Antithesis POCs
  • Release notes
  • Release notes
  • General reliability resources
  • Reliability glossary
  • Techniques for better software testing
  • Autonomous testing
  • Deterministic simulation testing
  • Property-based testing
  • White paper — How much does an outage cost?
  • Catalog of reliability properties for key-value datastores
  • Catalog of reliability properties for blockchains
  • Test ACID compliance with a ring test