Copy failed spec names to clipboard from MR widget
What does this MR do and why?
Adds an easy way to copy the path of all tests with failures so users can rerun them locally. The button can be found in the test results of the MR widget.
Also adds a copy-to-clipboard button for individual tests in the test case modal.
Screenshots or screen recordings
Copying test files:
Test Case | Recording |
---|---|
Copy all failed specs | Screen_Recording_2022-07-06_at_17.13.57 |
Copy individual spec files | Screen_Recording_2022-07-06_at_17.14.17 |
Rendering Conditions:
Test Case | Screenshot |
---|---|
Button should not show up when pipeline is successful | |
Button should not show up when data failed to load | |
Button should show up in the dropdown on smaller screens |
How to set up and validate locally
Setup
- Enable the
refactor_mr_widgets_extensions
feature flag. (echo "Feature.disable(:refactor_mr_widgets_extensions)" | rails c
) - Set up your project to use unit test reports; or clone this project and set it up with GDK.
- Run a pipeline from the default branch.
- Edit files to make some tests fail then open a merge request.
- If you cloned the above project, you can just create an MR from the
failing-specs
branch.
- Wait for the pipeline to finish.
Test Cases
- In the test reports of the MR page, click on the vertical ellipses next to the
Full Report
link. This should copy all the failing specs to your clipboard. - Expand the tab and view an individual test case. In the modal, you should be able to copy the file path through the copy-to-clipboard button.
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 Mireya Andres