|
9 | 9 | from sentry.grouping.grouptype import ErrorGroupType |
10 | 10 | from sentry.incidents.grouptype import MetricIssue |
11 | 11 | from sentry.incidents.utils.types import DATA_SOURCE_SNUBA_QUERY_SUBSCRIPTION |
| 12 | +from sentry.issues.grouptype import FeedbackGroup |
12 | 13 | from sentry.issues.ingest import save_issue_occurrence |
13 | 14 | from sentry.models.group import Group |
14 | 15 | from sentry.rules.match import MatchType |
@@ -524,3 +525,33 @@ def test_schedule_delayed_workflows_integration(self, mock_trigger: MagicMock) - |
524 | 525 | ) |
525 | 526 | == {} |
526 | 527 | ) |
| 528 | + |
| 529 | + |
| 530 | +class TestWorkflowEngineIntegrationFromFeedbackPostProcess(BaseWorkflowIntegrationTest): |
| 531 | + @override_options({"workflow_engine.issue_alert.group.type_id.rollout": [6001]}) |
| 532 | + @with_feature("organizations:workflow-engine-single-process-workflows") |
| 533 | + def test_workflow_engine(self) -> None: |
| 534 | + occurrence_data = self.build_occurrence_data( |
| 535 | + type=FeedbackGroup.type_id, |
| 536 | + event_id=self.event.event_id, |
| 537 | + project_id=self.project.id, |
| 538 | + evidence_data={ |
| 539 | + "contact_email": "[email protected]", |
| 540 | + "message": "test", |
| 541 | + "name": "Name Test", |
| 542 | + "source": "new_feedback_envelope", |
| 543 | + "summary": "test", |
| 544 | + }, |
| 545 | + ) |
| 546 | + |
| 547 | + self.occurrence, group_info = save_issue_occurrence(occurrence_data, self.event) |
| 548 | + assert group_info is not None |
| 549 | + |
| 550 | + self.group = Group.objects.get(grouphash__hash=self.occurrence.fingerprint[0]) |
| 551 | + assert self.group.type == FeedbackGroup.type_id |
| 552 | + |
| 553 | + with mock.patch( |
| 554 | + "sentry.workflow_engine.tasks.workflows.process_workflows_event.apply_async" |
| 555 | + ) as mock_process_workflow: |
| 556 | + self.call_post_process_group(self.group.id) |
| 557 | + mock_process_workflow.assert_called_once() |
0 commit comments