Skip to content

Adding a metric without a definition doesn't fail `every_metric_definition_spec.rb` specs

Michał Wielich requested to merge michold-every-metr-c-test-fix into master

What does this MR do and why?

Related to #366844 (closed)

We're adding a fix to one of our tests, as we found an edge case for which it didn't catch issues [explained further in validation steps].

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Add a new metric to Usage Ping without adding its definition, for example: change line 77 in usage_data.rb to undefined_metric: 1, assignee_lists: count(List.assignee),
  2. Run the specs edited in this MR - https://gitlab.com/gitlab-org/gitlab/blob/master/ee/spec/config/metrics/every_metric_definition_spec.rb
  3. This spec should pass on master branch and fail on this MR's branch.

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 Michał Wielich

Merge request reports