Add details to test summary merge request report widget
What does this MR do and why?
For #351258 (closed): This MR covers that issue except for the modal, which is to say it adds
- the list of failed/fixed tests at level three of the widget and
- the messages about recently failed tests to the widget (
N out of M failed tests failed more than once in the last 14 days
andFailed N times in main in the last 14 days
)
The test case names won't be styled like links (as they are in the mockup) because they don't open a modal yet.
For #358184 (closed): this MR also puts this widget refactor behind the refactor_mr_widget_test_summary
feature flag to avoid delaying the rollout of other widgets while we figure out modal support.
Screenshots or screen recordings
Screen_Recording_2022-04-08_at_21.14.51
before (from the last iteration) | after (with this MR) |
---|---|
(screenshot modified to show full content) |
reference: old widget | reference: mockup from figma |
---|---|
How to set up and validate locally
git checkout 351258-test-summary-widget-details
echo "Feature.enable(:refactor_mr_widget_test_summary)" | rails c
- set up unit test reports for a project OR clone this test project
- open a merge request in the project that changes the results of some tests relative to the target/main branch
- run pipelines for the merge request's branch and the target/main branch to generate test report artifacts
- accumulate some recent test failures in the target/main branch of the project OR apply this patch to mock some random numbers in as recent failure data for testing:
diff --git a/lib/gitlab/ci/reports/test_case.rb b/lib/gitlab/ci/reports/test_case.rb
index 09121191047..c0de16fda3c 100644
--- a/lib/gitlab/ci/reports/test_case.rb
+++ b/lib/gitlab/ci/reports/test_case.rb
@@ -24,7 +24,7 @@ def initialize(params)
@attachment = params.fetch(:attachment, nil)
@job = params.fetch(:job, nil)
- @recent_failures = nil
+ @recent_failures = { count: rand(0..(rand(0..7))), base_branch: "main" }
@key = hash_key("#{suite_name}_#{classname}_#{name}")
end
Caveat with this patch: since it's random, it might assign recent failures to tests that haven't failed; with real data, recent failure data is only surfaced for failed tests
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.