Skip to content

Make it possible to define a coverage regexp in job's configuration in YAML

Currently we can configure coverage regexp in CI/CD Pipeline settings, but since GitLab Runner has a parallel nature and we are not able to configure on which job GitLab has to look at, this may be unusable when someone parallelizes tests heavily (like we do).

One solution for that would be to move definition of coverage regexpfrom UI settings to.gitlab-ci.yml`. When someone defines:

rspec:
  variables: 
    SIMPLE_COV: 1
  script: rspec
  coverage: /(\d+.\d+\%) covered/ 

If this regexp will match against build log, job will have this coverage. If multiple jobs will have coverage regexp configured, we will use arithmetic mean, exactly like we do that now.

With that approach, however, we are able to exclude irrelevant jobs. Making this globally definable and job-level overridable we can maintain 100% backward compatibility.

What do you think @ayufan @markpundsack @tmaczukin?