oncall-engine/engine/apps/alerts/tests
Joey Orlando 4d655dff60
modify check_escalation_finished_task task (#1266)
# What this PR does

This PR:
- modifies the `check_escalation_finished_task` celery task to:
  - do stricter escalation validation based on the alert group's
escalation snapshot (see the `audit_alert_group_escalation` method in
`engine/apps/alerts/tasks/check_escalation_finished.py` for the
validation logic)
- use a read-only database for querying alert-groups if one is
configured, otherwise use the "default" one
- ping a configurable heartbeat (new env var
`ALERT_GROUP_ESCALATION_AUDITOR_CELERY_TASK_HEARTBEAT_URL` added)
- increase the task frequency from every 10 to every 13 minutes (this
can be configured via an env variable)
  - adds public documentation on how to configure this auditor task
- modifies the local celery startup command to properly take into
consideration all celery related env vars (similar to the ones we use in
`engine/celery_with_exporter.sh`; this made it easier to enable `celery
beat` locally for testing)
- removes the following code:
- removes references to `AlertGroup.estimate_escalation_finish_time` and
marks the model field as deprecated using the [`django-deprecate-fields`
library](https://pypi.org/project/django-deprecate-fields/). This field
was only used for the previous version of this validation task
- `EscalationSnapshotMixin.calculate_eta_for_finish_escalation` was only
used to calculate the value for
`AlertGroup.estimate_escalation_finish_time`
  - `calculate_escalation_finish_time` celery task
  

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/1558

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated
2023-03-17 10:14:08 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
conftest.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
factories.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_alert.py Add escalation chain option when creating a direct page alert group (#1143) 2023-01-18 12:58:26 -03:00
test_alert_group.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
test_alert_group_renderer.py Refactor get_user_verbal_for_team_for_slack. (#809) 2023-03-07 10:09:37 +00:00
test_alert_manager.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_alert_receiver_channel.py Handle scenario when multiple general team manual integrations are available 2022-10-21 14:23:45 -03:00
test_channel_filter.py Jinja2 based routes (#1319) 2023-03-08 16:42:18 +08:00
test_check_escalation_finished_task.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
test_custom_button.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_default_templates.py Restore email notifications (#621) 2022-10-19 12:32:56 +01:00
test_escalation_chain.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_escalation_policy_snapshot.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
test_escalation_snapshot.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
test_escalation_snapshot_mixin.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
test_incident_log_builder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_maintenance.py Insight logs (#348) 2022-08-24 12:04:44 +05:00
test_notify_ical_schedule_shift.py Fix failing test related to users org caching 2022-10-25 14:27:27 -03:00
test_notify_user.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
test_paging.py Keep track of direct paging schedule/importance in logs (#1269) 2023-02-02 09:21:31 -03:00
test_representative.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_silence.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_terraform_renderer.py Fix terraform render test to avoid intermittent fail 2022-07-28 10:16:43 -03:00
test_utils.py Fix outgoing webhook to resolve IP from parsed hostname 2022-09-22 14:35:37 -03:00
test_wipe.py World, meet OnCall! 2022-06-03 08:09:47 -06:00