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:
- A single test template containing a handful of test commands can produce thousands of meaningful test scenarios.
- 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:
- Creating test templates
- Test commands
- How to check a test template locally
- How to port tests to Antithesis