Launching a test in Kubernetes environment
This endpoint kicks off a test in our Kubernetes environment.
It first fetches the relevant container images, specified by the digest in the antithesis.images
parameter.
After fetching the images, Antithesis builds the test environment and runs your test for a number of minutes set in antithesis.duration
.
This webhook can be triggered by your CI system and we recommend setting your CI up to do this.
For more details on setting up CI, or to receive results in Slack, Discord, read about our available integrations.
curl --fail -u 'USER:PASSWORD' \
-X POST https://<TENANT>.antithesis.com/api/v1/launch/basic_k8s_test \
-d '{"params": { "antithesis.description":"basic_k8s_test on main",
"antithesis.duration":"length_in_minutes",
"antithesis.config_image":"config_image_with_tag",
"antithesis.images":"my_images_with_version_list",
"antithesis.report.recipients":"foo@email.com;bar@email.com"
} }'
Response
This webhook returns an HTTP status code to indicate whether it successfully started the test. This code is not your test result, it just indicates whether your webhook call worked.
Curl (and similar tools) will exit successfully so long as the webhook returns anything at all, even if it returns a failure code. The --fail
flag in the example below checks that command returned a success code.
Authentication
Antithesis webhooks use basic auth credentials for authentication.
USER:PASSWORD
The basic auth machine credentials for your tenant.
<TENANT>
Your tenant’s name.
Parameters
The following parameters can be used to configure the webhook. All parameters are optional.
If you want additional ways to parametrize your tests, we can create custom parameters for you, just reach out at support@antithesis.com.
These parameters are passed as JSON according to the following template:
{
"params": {
"parameter1_name": "parameter1_value",
"parameter2_name": "parameter2_value",
}
}
antithesis.config_image
string
The image version of your config image. This should be a single image version formatted in the same way as those in the antithesis.images
parameter.
Examples:
"antithesis.config_image": "image_name:latest_tag"
antithesis.description
string
A description of your test run that’ll be in the headers of the generated report and of any emails triggered by the test run.
antithesis.duration
string
Desired duration of your test run in minutes.
antithesis.images
string
A ;
-delimited list of image versions of the software to be tested. Each entry in the format [REGISTRY/]NAME(:TAG|@DIGEST)
.
It’s recommended to use a digest
over a tag
. Images specified by digest will be tagged as latest
within the Antithesis environment.
The default registry will be us-central1-docker.pkg.dev/molten-verve-216720/$TENANT_NAME-repository/
.
Examples:
"antithesis.images": "registry/container:some_tag"
"antithesis.images": "container_1@sha256:12341234; registry/container_2:latest_tag"
"antithesis.images": "registry/container_1:sha256:12341235; registry/container_2:latest_tag; container_3@sha256:56785678"
antithesis.is_ephemeral
string
A boolean (represented as "true"
or "false"
) that indicates whether or not webhooks’s results should be reflected in future reports as a historic result.
- Set this to
"true"
when kicking-off one-off, exploratory runs. Failing to set this will result in confusing test history. - Leave this
"false"
(which is the default) when running scheduled tests.
antithesis.report.recipients
string
A ;
-delimited list of recipients of emailed links to the triage report produced by this test run.
If this parameter is not specified, emails will be sent to the default users set up for the endpoint.
Examples:
"antithesis.report.recipients": "foo@my-site.com"
"antithesis.report.recipients": "u1@site.com; u2@site.com"
antithesis.source
string
An identifier to separate property history in reports.
In the resulting report, each property’s history is generated from all previous runs with the same antithesis.source
parameter. This allows you to (for example) easily see the history of tests on a single branch.
The parameter may be arbitrary text, but you will likely provide a source control descriptor.
Tooling integration parameters
These parameters allow you to post the results of test runs back to the platform of your choice. In some cases, such as the Antithesis Github action, these parameters are automatically configured and you will not need to set them manually.
antithesis.integrations.<integration_type>.callback_url
string
The callback URL.
antithesis.integrations.<integration_type>.token
string
A secret token.
<integration_type>
string
Accepted integration types are github
, discord
, and slack
.
You may post results back to as many different platforms as you like. For example, the following will post results back to both Discord and to Github:
curl --fail -u 'user:password' \
-X POST https://<tenant>.antithesis.com/api/v1/launch/<endpoint> \
-d '{"params": { "antithesis.description":"Nightly testing on main",
"antithesis.integrations.discord.callback_url": "https://discord.com/api/webhooks/1234567890123456789/",
"antithesis.integrations.discord.token": "<secret>",
"antithesis.integrations.github.callback_url": "<url>",
"antithesis.integrations.github.token": "<secret>",
"antithesis.images":"my_images_with_version_list" } }'
Deprecated parameters
The following parameters are deprecated.
antithesis.integrations.type
The CI / Source Control integration type.
Values: ["none", "github"]
.
Default value: "none"
.
antithesis.integrations.callback_url
The URL Antithesis will call back to post the test results.
antithesis.integrations.token
A security token used to authenticate when calling back with results.