oncall-engine/engine/apps/alerts/tests
Matias Bordese fa815b7ecd
Reworked declare incident escalation step (#5130)
Reworked https://github.com/grafana/oncall/pull/5047. Main update is the
switch from FK to a [M2M
relation](https://docs.google.com/document/d/1HeulqxoFShSHtInQrZNJLL5MDlHPNT50rVGaK3zZWvw/edit?disco=AAABVLjV4W8)
(which doesn't really change the original/intended behavior, besides not
needing to alter the alert group table, and it is a bit more flexible;
the extra table shouldn't introduce issues because this is used only for
tracking purposes and the information needed in the log record is
already there).

Avoid a db migration involving alert group table:

```
--
-- Create model RelatedIncident
--
CREATE TABLE `alerts_relatedincident` (`id` bigint AUTO_INCREMENT NOT NULL PRIMARY KEY, `incident_id` varchar(50) NOT NULL, `created_at` datetime(6) NOT NULL, `is_active` bool NOT NULL, `channel_filter_id` bigint NULL, `organization_id` bigint NOT NULL);
CREATE TABLE `alerts_relatedincident_attached_alert_groups` (`id` bigint AUTO_INCREMENT NOT NULL PRIMARY KEY, `relatedincident_id` bigint NOT NULL, `alertgroup_id` bigint NOT NULL);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincident_organization_id_incident_id_d7fc9a4f_uniq` UNIQUE (`organization_id`, `incident_id`);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincide_channel_filter_id_9556c836_fk_alerts_ch` FOREIGN KEY (`channel_filter_id`) REFERENCES `alerts_channelfilter` (`id`);
ALTER TABLE `alerts_relatedincident` ADD CONSTRAINT `alerts_relatedincide_organization_id_74ed6bed_fk_user_mana` FOREIGN KEY (`organization_id`) REFERENCES `user_management_organization` (`id`);
CREATE INDEX `alerts_relatedincident_incident_id_8356a799` ON `alerts_relatedincident` (`incident_id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincident_a_relatedincident_id_alert_3d683baa_uniq` UNIQUE (`relatedincident_id`, `alertgroup_id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincide_relatedincident_id_3e5e7a23_fk_alerts_re` FOREIGN KEY (`relatedincident_id`) REFERENCES `alerts_relatedincident` (`id`);
ALTER TABLE `alerts_relatedincident_attached_alert_groups` ADD CONSTRAINT `alerts_relatedincide_alertgroup_id_0125deca_fk_alerts_al` FOREIGN KEY (`alertgroup_id`) REFERENCES `alerts_alertgroup` (`id`);
```
2024-10-07 19:26:10 +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 Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
test_acknowledge_reminder.py Update xdist load to use loadscope setting (#4187) 2024-04-08 19:03:58 +00:00
test_alert.py Handle alert group deleted when task is already queued (#4230) 2024-04-16 14:39:00 +00:00
test_alert_group.py Ignore resolve condition template if source resolving is disabled (#5049) 2024-09-23 18:01:59 +00:00
test_alert_group_log_record.py Include link information for objects referenced in alert group timeline (#5123) 2024-10-03 19:24:26 +00:00
test_alert_group_renderer.py Revert "Fix <a> link escaping in web template" (#5024) 2024-09-13 20:27:15 +00:00
test_alert_manager.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_alert_receiver_channel.py Add tilt button to run pytest, fix local dev config for pytest, minor improvements to til (#3927) 2024-07-09 01:24:18 +00:00
test_channel_filter.py Allow routing via labels on the Integration page (#3850) 2024-07-15 07:43:40 +00:00
test_check_escalation_finished_task.py Ignore uncompleted notifications if policy is deleted (#4260) 2024-04-23 11:40:24 +00:00
test_custom_webhook_result.py Add escalation chain support for new webhooks (#1654) 2023-04-05 12:03:55 +00:00
test_default_templates.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
test_escalation_chain.py Allow changing team for escalation chains (#1658) 2023-03-30 10:43:00 +01:00
test_escalation_policy_snapshot.py Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
test_escalation_snapshot.py Clean up reverted migration (#5119) 2024-10-03 16:51:40 +00:00
test_escalation_snapshot_mixin.py Add escalation step to notify all members from a team (#3908) 2024-02-20 10:02:23 -03:00
test_grafana_alerting_sync.py New OnCall plugin initialization process (#4657) 2024-08-16 16:43:52 +00:00
test_incident_log_builder.py Fix notification plan builder (#4726) 2024-07-24 15:49:03 +00:00
test_maintenance.py Enable flake8-bugbear, fix issues (#3454) 2023-11-29 15:04:48 +00:00
test_notify_all.py Fix order filtering when executing notify all/group steps from snapshot (#4381) 2024-05-23 12:36:28 +00:00
test_notify_group.py Fix order filtering when executing notify all/group steps from snapshot (#4381) 2024-05-23 12:36:28 +00:00
test_notify_ical_schedule_shift.py Move cache clear to fixtures, fix some deprecation notices (#3269) 2023-11-06 16:52:50 +00:00
test_notify_user.py Fix direct paging ack (#4957) 2024-08-30 09:17:09 +00:00
test_paging.py fix: sanitize email HTML templates (#5108) 2024-10-02 15:55:24 +00:00
test_related_incident.py Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
test_representative.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_silence.py OnCall prometheus metrics exporter (#1605) 2023-05-25 18:26:13 +00:00