Discord and Slack integrations#

When you run tests, Antithesis will generate triage reports and email them to you. In addition, you may configure the test to post back results to a platform of your choice. This document covers how to configure this integration with Discord and Slack.

The example below kicks off a test and posts the results back to Discord (and also Github):

curl --fail -u 'user:password' \
-X POST https://<tenant>.antithesis.com/api/v1/launch_experiment/<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.gitub.token": "<secret>",
    "antithesis.images":"my_images_with_version_list" } }'

See the webhooks documentation for the syntax of webhook calls in general. The remainder of this document describes how to generate the following webhook parameters:

antithesis.integrations.<integration type>.callback_url
antithesis.integrations.<integration type>.token

where <integration type> is discord or slack.

Discord#

  1. Begin with the server that you want your Antithesis results to be posted back to.

  2. Navigate to Server Settings and then to Integrations.

  3. Create a new webhook.

  4. Copy the webhook URL.

The URL will look something like:

https://discord.com/api/webhooks/000000000000000000/1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Everything after the final frontslash is the token. Everything up to and including the final forward slash is the callback url. In this case:

antithesis.integrations.discord.callback_url: https://discord.com/api/webhooks/000000000000000000/
antithesis.integrations.discord.token: 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

You should treat the token as a secret.

Consult the Discord webhook docs for further details on this integration.

When this integration is enabled, you will see results like the following:

../_images/discord-image.png

Slack#

  1. Create a Slack app associated with the workspace that you want results posted back to.

  2. Ensure that incoming webhooks are enabled and click the button labeled Add New Webhook to Workspace.

  3. Pick a channel that you want your Antithesis results to be posted back to, and click Authorize.

  4. In your app settings, observe the entry under Webhook URLs for Your Workspace. Copy the webhook URL.

The URL will look something like:

https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Everything after the final frontslash is the token. Everything up to and including the final forward slash is the callback url. In this case:

antithesis.integrations.slack.callback_url: https://hooks.slack.com/services/T00000000/B00000000/
antithesis.integrations.slack.token: XXXXXXXXXXXXXXXXXXXXXXXX

You should treat the token as a secret.

Consult the Slack webhook docs for further details on this integration.

When this integration is enabled, you will see results like the following:

../_images/slack-image.png