def test_no_issues(self): result = get_processing_issues(self.user, [self.project])[0] assert not result["hasIssues"] assert not result["hasMoreResolveableIssues"] assert result["numIssues"] == 0 assert result["issuesProcessing"] == 0 assert result["resolveableIssues"] == 0
def test_full(self): issue = ProcessingIssue.objects.create( project_id=self.project.id, checksum="abc", type=EventError.NATIVE_MISSING_DSYM) raw_event = RawEvent.objects.create(project_id=self.project.id, event_id="abc") EventProcessingIssue.objects.create(raw_event=raw_event, processing_issue=issue) RawEvent.objects.create(project_id=self.project.id, event_id="jkl") ReprocessingReport.objects.create(project=self.project, event_id="abc") ReprocessingReport.objects.create(project=self.project, event_id="def") ProcessingIssue.objects.create(project_id=self.project.id, checksum="def", type=EventError.NATIVE_INTERNAL_FAILURE) ProcessingIssue.objects.create(project_id=self.project.id, checksum="jkl", type=EventError.NATIVE_MISSING_SYMBOL) result = get_processing_issues(self.user, [self.project])[0] assert result["hasIssues"] assert not result["hasMoreResolveableIssues"] assert result["numIssues"] == 3 assert result["issuesProcessing"] == 2 assert result["resolveableIssues"] == 1
def test_simple(self): raw_event = RawEvent.objects.create(project_id=self.project.id, event_id="abc") issue = ProcessingIssue.objects.create( project_id=self.project.id, checksum="abc", type=EventError.NATIVE_MISSING_DSYM) EventProcessingIssue.objects.create(raw_event=raw_event, processing_issue=issue) ProcessingIssue.objects.create(project_id=self.other_project.id, checksum="abc", type=EventError.NATIVE_MISSING_DSYM) ProcessingIssue.objects.create(project_id=self.other_project.id, checksum="def", type=EventError.NATIVE_MISSING_SYMBOL) expected = get_processing_issues(self.user, [self.project, self.other_project]) response = self.get_success_response(self.project.organization.slug, project=[self.project.id]) assert len(response.data) == 1 assert response.data[0] == expected[0] response = self.get_success_response( self.project.organization.slug, project=[self.project.id, self.other_project.id]) assert len(response.data) == 2 assert list(sorted(response.data, key=lambda item: item["project"])) == expected
def test_full(self): issue = ProcessingIssue.objects.create( project_id=self.project.id, checksum='abc', type=EventError.NATIVE_MISSING_DSYM, ) raw_event = RawEvent.objects.create(project_id=self.project.id, event_id='abc') EventProcessingIssue.objects.create( raw_event=raw_event, processing_issue=issue, ) RawEvent.objects.create(project_id=self.project.id, event_id='jkl') ReprocessingReport.objects.create(project=self.project, event_id='abc') ReprocessingReport.objects.create(project=self.project, event_id='def') ProcessingIssue.objects.create( project_id=self.project.id, checksum='def', type=EventError.NATIVE_INTERNAL_FAILURE, ) ProcessingIssue.objects.create( project_id=self.project.id, checksum='jkl', type=EventError.NATIVE_MISSING_SYMBOL, ) result = get_processing_issues(self.user, [self.project])[0] assert result['hasIssues'] assert not result['hasMoreResolveableIssues'] assert result['numIssues'] == 3 assert result['issuesProcessing'] == 2 assert result['resolveableIssues'] == 1
def test_no_issues(self): result = get_processing_issues(self.user, [self.project])[0] assert not result['hasIssues'] assert not result['hasMoreResolveableIssues'] assert result['numIssues'] == 0 assert result['issuesProcessing'] == 0 assert result['resolveableIssues'] == 0
def get(self, request, project): """ List a project's processing issues. """ data = get_processing_issues( request.user, [project], include_detailed_issues=request.GET.get("detailed") == "1")[0] return Response(serialize(data, request.user))
def get(self, request, project): """ List a project's processing issues. """ data = get_processing_issues( request.user, [project], include_detailed_issues=request.GET.get('detailed') == '1', )[0] return Response(serialize(data, request.user))
def test_simple(self): raw_event = RawEvent.objects.create(project_id=self.project.id, event_id="abc") issue, _ = ProcessingIssue.objects.get_or_create( project_id=self.project.id, checksum="abc", type=EventError.NATIVE_MISSING_DSYM ) EventProcessingIssue.objects.get_or_create(raw_event=raw_event, processing_issue=issue) result = get_processing_issues(self.user, [self.project])[0] assert result["hasIssues"] assert not result["hasMoreResolveableIssues"] assert result["numIssues"] == 1 assert result["issuesProcessing"] == 0 assert result["resolveableIssues"] == 0
def get(self, request: Request, organization) -> Response: """ For each Project in an Organization, list its processing issues. Can be passed `project` to filter down to specific projects. :pparam string organization_slug: the slug of the organization. :qparam array[string] project: An optional list of project ids to filter to within the organization :auth: required """ data = get_processing_issues( request.user, self.get_projects(request, organization), request.GET.get("detailed") == "1", ) return Response(serialize(data, request.user))
def get(self, request, organization): """ For each Project in an Organization, list its processing issues. Can be passed `project` to filter down to specific projects. :pparam string organization_slug: the slug of the organization. :qparam array[string] project: An optional list of project ids to filter to within the organization :auth: required """ data = get_processing_issues( request.user, self.get_projects(request, organization), request.GET.get('detailed') == '1', ) return Response(serialize(data, request.user))
def test_simple(self): self.login_as(user=self.user) raw_event = RawEvent.objects.create(project_id=self.project.id, event_id='abc') issue = ProcessingIssue.objects.create( project_id=self.project.id, checksum='abc', type=EventError.NATIVE_MISSING_DSYM, ) EventProcessingIssue.objects.create( raw_event=raw_event, processing_issue=issue, ) ProcessingIssue.objects.create( project_id=self.other_project.id, checksum='abc', type=EventError.NATIVE_MISSING_DSYM, ) ProcessingIssue.objects.create( project_id=self.other_project.id, checksum='def', type=EventError.NATIVE_MISSING_SYMBOL, ) expected = get_processing_issues(self.user, [self.project, self.other_project]) response = self.get_valid_response( self.project.organization.slug, project=[self.project.id], ) assert response.status_code == 200, response.content assert len(response.data) == 1 assert response.data[0] == expected[0] response = self.get_valid_response( self.project.organization.slug, project=[self.project.id, self.other_project.id], ) assert response.status_code == 200, response.content assert len(response.data) == 2 assert list(sorted(response.data, key=lambda item: item['project'])) == expected