Configuring the Sanity Runner
For the client, you can run:
yarn dlx sanity-runner-client --help
for a list of CLI options. Most options can also be passed in via a config file.
Terraform Module
Input Variables
Variable | Default Value | Description |
---|---|---|
function_name | "sanity-runner" | Name for the lambda function deploys |
container_version | "2.0.0" | Version of Service Container to deploy to the lambda (ghcr.io/tophat/sanity-runner-service) |
vpc_sg_ids | [] | Security Group IDs to associate with lambda. Enables VPC mode. If used, requites vpc_subnet_ids to also be set |
vpc_subnet_ids | [] | Subnet Ids to associate with the lambda. Enables VPC mode. If used, requites vpc_sg_ids to also be set |
memory_size | 2048 | Memory_size for lambda |
timeout | 600 | Sets Default timeout for lambda invocation |
environment | {} | Sets additional env vars for the lambda |
image_uri | "" | Lets you set a custom image for the lambda |
Alerting
Slack
For Slack alerting, you must provide a Slack API key in AWS Secret Manager with a name conforming to the pattern:
key: sanity_runner/slack_api_tokensecret: slack_api_tokenvalue: <api token>
When the Slack integration is enabled, the Slack channel and Slack team handle will be parsed from the docstring present in the failed sanity test. At the top of your sanity test file, add the docstring like so:
/*** @Slack #some-slack-channel* @SlackHandler @owning-team-handle* @Description* - Instructions* - for the team*/
PagerDuty
For PagerDuty alerting, an integration key is required. The key must be stored in AWS Secret Manager at:
key: sanity_runner/pagerduty_<name of pagerduty service>secret: integration_keyvalue: <integration key>
Similar to Slack, you must specify the PagerDuty service via a docstring:
/*** @Pagerduty pagerduty-service* @Description* - Instructions* - for the team*/