Skip to content

Commit

Permalink
Add 'ALERT_TEST' check during alert tests
Browse files Browse the repository at this point in the history
This makes the notification that gets created more obvious, as it will
show ALERT_TEST as the failing check
  • Loading branch information
frankh committed Apr 19, 2017
1 parent a6171d6 commit f3203e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cabot/cabotapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ def post(self, request):
with transaction.atomic():
sid = transaction.savepoint()
service.update_status()
check = StatusCheck(name='ALERT_TEST', calculated_status=data['new_status'])
check.save()
service.status_checks.add(check)

service.overall_status = data['new_status']
service.old_overall_status = data['old_status']
Expand All @@ -720,6 +723,9 @@ def post(self, request):
service = Service.objects.create(
name='test-alert-service'
)
check = StatusCheck(name='ALERT_TEST', calculated_status=data['new_status'])
check.save()
service.status_checks.add(check)
service.users_to_notify.add(request.user)
service.alerts.add(data['alert_plugin'])
service.update_status()
Expand Down

0 comments on commit f3203e5

Please sign in to comment.