Skip to content

Create test reports widget

Felipe Cardozo requested to merge issue_382590-create_test_reports_widget into master

What does this MR do and why?

Introduce test reports widget for work items and expose it on GraphQL.

This only exposes testReports collection. In a follow-up, we should also add lastTestReportManuallyCreated field.

related to #382590 (closed)

How to set up and validate locally

Requirements feature is only available with an Ultimate license.

  1. Create a requirement work item using GitLab UI and take its global id. You can take the global id using Graphql or executing the following in rails console:
  WorkItem.requirement.last.to_global_id.to_s
  1. Create test reports for the requirement. It is possible to generate test reports objects manually by switching a requirement status using the UI. To do that you can edit a requirement twice, toggling it to satisfied and then to failed, this should associate two test reports objects to it.
  2. Execute the following GraphQL query using the requirement global id created in the first step:
query workItem {
  workItem(id: "REQUIREMENT_GLOBAL_ID") {
    title
    widgets {
      ... on WorkItemWidgetTestReports {
        testReports {
          edges {
            node {
              id
              state
            }
          }
        }
      }
    }
  }
}

You should see a collection of test reports associated to the requirement.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Felipe Cardozo

Merge request reports

Loading