Skip to content

Migrate test report widget to V2

Miranda Fluharty requested to merge 419150-migrate-test-summary-widget into master

What does this MR do and why?

For #419150 (closed)

Migrate test report widget to V2

Rewrite test report widget to use widget.vue instead of returning an object

Changelog: changed

Screenshots or screen recordings

Before After
Screenshot_2023-08-02_at_00.40.32 Screenshot_2023-08-02_at_00.48.34
widget.js returns an object that gets converted into a widget extension, has the old widget styling widget.vue returns a vue component containing an <MrWidget /> component that gets rendered in the widget app, has the new widget styling

How to set up and validate locally

  1. find/make a project with a pipeline that generates a unit test report
  2. run a pipeline for a merge request in that project and wait for it to finish
  3. the test summary widget should appear on the merge request
    • while loading, it should display a loading state:
      Screenshot_2023-08-02_at_15.50.50
    • with data, it should display a summary of all test suites on the first level, along with a link to the full report and the "copy failed tests" action
    • when expanded, it should display:
      • a summary of each suite at the second level
      • at the third level, nested inside the suite summary, a scrollable list of tests from that suite that produced different results compared to when they ran for the base pipeline (tests that this MR has broken or fixed)
      • clicking the "View details" action next to a test should open a modal with more details
        • this is the same modal that's used in the Full report, and it should still open to show more details there too
    • if the test report could not be parsed, the widget should be expandable to display the parsing error:
      Screenshot_2023-08-01_at_22.18.35
    • if the test report could not be loaded, it should display a generic error state:
      Screenshot_2023-08-02_at_15.37.49
    • if recent failures statistics are available, they should be shown at the summary levels (i.e. "3 out of 10 failed tests have failed in main in the last 14 days") and as a header on the test ("Failed 82 times in main in the last 14 days"):
      Screenshot_2023-08-02_at_16.04.12

to run tests

yarn install
yarn jest vue_merge_request_widget/extensions/test_report

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 Miranda Fluharty

Merge request reports