Errors from test report parsing should be surfaced to the UI
### Overview Since the refactoring of the unit test report page to use the [test_report_summary](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/ci/pipeline.rb#L920-924) mechanism we are no longer surfacing parsing errors to the UI. ### Problem to solve As a GitLab user, I want to see detailed error information surfaced to the UI when my unit test reports cannot be parsed for some reason in order to fix those errors and enable myself to use this feature. ### Proposal We need to display the error in two places: 1. MR Widget, probably include the error in the `test_reports.json` response. 1. Test Summary on the pipelines page. #### Backend 1. Persist `suite_error` in our [summary data](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/ci/build_report_result_service.rb#L28-39) - **test_suite.suite_error** 1. Create new method in our [TestSuiteSummary](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/reports/test_suite_summary.rb) 1. Expose it in our [TestSuiteSummaryEntity API](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/serializers/test_suite_summary_entity.rb) 1. Level up the `suite_error` at the [TestReportSummary level](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/reports/test_report_summary.rb) 1. Expose it to our [TestReportSummary entity](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/serializers/test_report_summary_entity.rb) 1. :tada: we are now able to expose errors on the ~frontend #### Frontend the ~frontend work consists of conditionally showing an error message on the test suite if that suite's test report is invalid (which I'm assuming the ~backend will be including in the already existing response). ### Original Issue The following discussion from !44615 should be addressed: - [ ] @iamricecake started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44615#note_426298180): > This message will be set in `test_suite.set_suite_error("JUnit data parsing failed: #{e}")`. But looks like we don't display the `TestSuite#suite_error` anymore on the UI. The `suite_error` is returned in this [endpoint](https://gitlab.com/gitlab-org/gitlab/blob/4f6cdc16b3779b4fcf798badb0e9ca61ad142323/app/controllers/projects/pipelines_controller.rb#L202-206) but it's not used anymore. > > We have to fix this in a follow-up to provide a helpful error message to the user. This would require both ~backend and ~frontend work.
issue