Skip to content

Draft: Include dependent child pipelines coverage into root parent pipeline's

What does this MR do?

Related to #280818

TODO:

  • fix MR widget that shows code coverage because it only looks for coverage jobs in the same pipeline. This should be abstracted and provided by backend. E.g. create a job rspec in parent pipeline that outputs code coverage value and a rspec job in the child pipeline that does the same with a different value. The MR widget should return an averaged coverage report.

image

The screenshot above should show 2 jobs (instead of 1) and an average of the 2 coverage values

Screenshots (strongly suggested)

# .gitlab-ci.yml
rspec:
  stage: test
  script:
    - echo "running rspec..."
    - echo "Code coverage 80"
  coverage: /Code coverage \d+/

trigger-tests:
  stage: test
  trigger:
    include: child.yml
    strategy: depend
# child.yml
rspec:
  script:
    - echo "Running tests..."
    - echo "Code coverage 40"
  coverage: /Code coverage \d+/

karma:
  script:
    - echo "running karma tests..."
    - echo "Code coverage 30"
  coverage: /Code coverage \d+/

We should expect that code coverage report for the parent pipeline is rspec: 60 and karma: 30. These values should also be available in the repository analytics.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Fabio Pitino

Merge request reports