Skip to content

Add Test Runs and Test Coverage Data to Project Quality Summary

What does this MR do and why?

For #341973 (closed), #322018 (closed)

This MR adds test run and test coverage data to the Project Quality Summary. Mainly this means building out the project_quality_summary/app.vue component to load data from GraphQL and display it in single stats inside of cards. This MR also adds tests for this functionality and a GraphQL fixture to generate data for the tests.

This page is behind the project_quality_summary_page feature flag, so this MR does not include a changelog or documentation.

This MR adds a generic loading state and flash message to show if loading fails, but the empty states for test runs and test coverage will be handled separately - this MR does not include empty states.

Screenshots or screen recordings

case screenshot
with coverage data (and no test run data) Screen_Shot_2021-12-10_at_15.43.33
with test run data (and no coverage data) Screen_Shot_2021-12-10_at_15.43.38
loading Screen_Shot_2021-12-09_at_14.42.44
error Screen_Shot_2021-12-10_at_15.47.05
tooltips Screen_Shot_2021-12-10_at_15.10.04

How to set up and validate locally

  1. git checkout 341973-add-coverage-to-project-quality-summary
  2. echo "Feature.enable(:project_quality_summary_page)" | rails c
  3. for Test runs:
    1. set up unit tests for a project (or clone this test project)
    2. run a pipeline for the default branch of that project that generates a unit test report
    3. navigate to the project => Analytics => CI/CD, then click the Project quality tab
    4. verify that the passed/failed/skipped percentages in the Test runs card is correct
  4. for Test coverage:
    1. set up coverage for a project (or clone this test project)
    2. run a pipeline for the default branch of that project that generates a coverage percentage
    3. navigate to the project => Analytics => CI/CD, then click the Project quality tab
    4. verify that the coverage percentage in the Test coverage card is correct

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