Skip to content

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 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.
  2. Test Summary on the pipelines page.

Backend

  1. Persist suite_error in our summary data - test_suite.suite_error
  2. Create new method in our TestSuiteSummary
  3. Expose it in our TestSuiteSummaryEntity API
  4. Level up the suite_error at the TestReportSummary level
  5. Expose it to our TestReportSummary entity
  6. 🎉 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 (merged) should be addressed:

  • @iamricecake started a discussion:

    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 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.

Edited by Ricky Wiens