Create test reports widget
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.
- 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
- 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.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Felipe Cardozo