How to Incorporate Slack Alerts into Your Development Process
Most developers today use instant messaging apps, like Slack, HipChat or Lync. These apps are used to communicate with other company members, but also to get automated alerts. For example, when their server is down, when a certain service isn’t working, when jobs fail or when CPU is too high. These notifications are important because they inform you of the status of your development, and let you quickly fix what needs fixing. Slack is also more convenient than emails because people often ignore them.
In this blog post I will show you what you need to do to get Slack notifications and alerts when you’re developing and testing. Then, I will show you how to get Slack notifications for your BlazeMeter tests.
1. First you need to create a new incoming webhook URL on Slack. Webhooks post external messages on Slack, by using HTTP requests with a JSON payload. To do that, go to this URL: https://slack.com/signin?redir=%2Fapps%2Fnew%2FA0F7XDUAZ-incoming-webhooks
(you will need to sign in with your team domain).
2. Choose the channel you want to get notifications to and click on ‘Add Incoming Webhooks integration’.
3. Copy the Webhook URL you receive:
4. You can customize the image and the name that you will receive notifications from:
5. Save your settings
6. Paste the URL you copied in the tools you are using for developing or testing. Each tool has a different configuration, so search the documentation for exact instructions on your tool.
For example, the configuration for codecov is defined in a file called `codecov.yml`. As you can see here, the webhook url is defined inside the “coverage” section. You get Slack notifications from codecov when the unittests-coverage delta is worst from what you demand.
BlazeMeter Slack Notifications
Now, BlazeMeter also supports integration with Slack for determining test failure according to the criteria you determine. The notification is sent directly to your channel or private room, so you can handle it quickly and efficiently. Until now, you could receive notifications when the test was saved, when it started and when it ended. But now, you are notified about your test passing or failing.
1. Go to Workspace settings -> Alerts > (+)
You will get this screen:
2. Configure the alert settings and fill in the email and/or Slack Webhook URL (creation is the same as described above) you want to receive notifications to. You will get a notification with a link to the report/test according to the trigger you set.
You can also configure Slack alerts via API. Just run the following lines in the command line:
That’s it! You now know how to get Webhook URL’s from Slack, what to do to add them to your tool and how to add Slack notifications to your BlazeMeter tests.
Do you want to see how BlazeMeter works? Just paste your URL in upload a JMX file into the box at the top of the page and your test will start in minutes. You can also request a demo.