Skip to content

Include coverage reports from child pipeline

What does this MR do and why?

Include coverage reports from child pipelines when creating pipeline coverage report.

Part of #363301 (closed).

Screenshots or screen recordings

In this sample MR, alberts-gitlab/test-ruby-cobertura!2, there is a parent and child pipeline set up to generate coverage. The parent pipeline generates coverage for demo.rb. The child pipeline generates coverage for demo_child.rb.

Before - coverage from child pipeline is not included: Screenshot_2022-05-30_at_5.33.04_PM

After - coverage from child pipeline is included: Screenshot_2022-05-30_at_5.33.27_PM

Example project and MR: alberts-gitlab/test-ruby-cobertura!2

How to set up and validate locally

  1. Clone project https://gitlab.com/alberts-gitlab/test-ruby-cobertura locally
  2. Pull branch https://gitlab.com/alberts-gitlab/test-ruby-cobertura/-/tree/test-coverage-child-pipeline containing CI and test changes to generate coverage from child pipeline.
  3. Create MR in GDK and wait for pipeline to succeed.
  4. Verify that the demo_child.rb coverage generated in the child pipeline is not shown in the MR diff.
  5. Enable feature flag ci_child_pipeline_coverage_reports.
    Feature.enable(:ci_child_pipeline_coverage_reports)
  6. Run a new pipeline on the branch and wait for it to succeed.
  7. Verify that the demo_child.rb coverage is now shown in the MR diff.

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 Albert

Merge request reports