-1

This is my first question on stack overflow. I'm trying to create a CI pipeline measuring the performance of our environment.

I've managed to create a locust file thats executing a given scenario. And right now I trying to integrate the pipeline with our slack channel. So I could see in an easy way if the scheduled job passed or failed - no need to log in to gitlab.

For regression tests I'm using pytest with pytest-slack plugin and it works fine. Unfortunately for locust I cannot find any available plugin.

The Gitlab - Slack integration is not working in the way I want because it's made for monitoring the pipelines for merges not for scheduled.

Thanks!

Adam O.
  • 3
  • 3

1 Answers1

0

Your question is a little hard to answer. Do you want help with Slack integration or with Locust?

In regards to Locust, you can make it give a non-zero exit code to "fail" the pipeline on certain conditions, and then do whatever you want with that using your pipeline.

An example (requires locust-plugins) is here: https://github.com/SvenskaSpel/locust-plugins/blob/5a57e10950c25025dc3e04785cb668d368271019/examples/cmd_line_examples.sh#L6

Cyberwiz
  • 11,027
  • 3
  • 20
  • 40
  • Thanks for replying. I know how to set an exit code. The only thing I need is reporting to slack. So I can in a fast way check if my scheduled pipeline with locust failed or passed. Something [like this](https://pypi.org/project/pytest-slack/) but for locust. – Adam O. Aug 03 '21 at 06:08
  • Ok! Well slack integration is pretty easy. Just a POST to the appropriate endpoint. I dont have a link to the documentation but it should be easy to find. I dont think you’ll find anything ”ready made” for locust-slack integration. – Cyberwiz Aug 03 '21 at 07:05
  • 1
    Ok thanks, just wanted to know if there's a ready solution. – Adam O. Aug 03 '21 at 07:47