Make it go

Before you deploy your software to Antithesis’s testing environment, you’ll need to add a test template to your containers and enable your software to signal that it’s ready.

While packaging your software is a thing you’ll need to do approximately once, these are things you’ll likely want to revisit once you’re more comfortable with Antithesis. The steps described here are intended to get you running your first test ASAP, but there are more powerful approaches to both.

6. Provide a basic test template

A test template is the code that makes your software do something. There’s a lot you can do with test templates (see test composition for more), but for the purpose of your first run, you can use one of your existing integration tests.

To do this, use the following naming conventions to enable Antithesis to detect and run your test. These conventions should be followed exactly.

  1. Create a directory called /opt/antithesis/test/v1/quickstart in any of your containers.

  2. Paste an existing integration test into an executable named singleton_driver_<your_test_name>.<extension> in the directory you just created. Make sure your executable has an appropriate shebang in the first line, e.g. #!/usr/bin/env bash

Now you’ll need to validate that your system can find the test template you just defined. The easiest way to do this is call docker compose exec on your test command and see if it runs.

$ docker compose exec <your_container_name> /opt/antithesis/test/v1/quickstart/singleton_driver_<your_test_name>

7. Have your software signal it’s ready

Before running any tests, Antithesis initializes your software and its dependencies. Once your system is up and running, it should emit the following JSONL message to initiate testing and fault injection.

{"antithesis_setup": { "status": "complete", "details": null }}

This message should be written to $ANTITHESIS_OUTPUT_DIR/sdk.jsonl – in our environment, we’ll ensure that this variable and the directory it points to always exist.

Note that details must not terminate with a newline, because the entire message must be JSONL. More details on this syntax here.

Our SDKs also provide pre-built ways to do this.

Once you’ve incorporated a way for your software to send that message, you’re ready to deploy everything to Antithesis’ testing environment.