Expand test selection for when changing metrics YAML files
Context
Follow-up of gitlab-org/quality/engineering-productivity/master-broken-incidents#287 (closed), where some metrics definitions were changed, and a spec that could have detected the problem wasn't triggered because of test selection.
What does this MR do and why?
If we change a ee
metric definition in ee/config/metrics/**/*.yml
, we'll run the specs in ee/spec/config/metrics/*_spec.rb
, as they are testing the metrics data structure.
We are NOT checking the non-ee
metrics, as we don't have any specs written for non-ee
metrics.
Results
ee/config/metrics/
When changing a file in https://gitlab.com/gitlab-org/gitlab/-/jobs/3530126910:
Changed files: ee/config/metrics/settings/20220218105708_version.yml tests.yml
Related RSpec tests: ee/spec/config/metrics/every_metric_definition_spec.rb
Related FOSS RSpec tests:
ee/lib/ee/gitlab/usage_data_counters/known_events
When changing a file in https://gitlab.com/gitlab-org/gitlab/-/jobs/3530203705:
Changed files: ee/lib/ee/gitlab/usage_data_counters/known_events/analytics.yml tests.yml
Related RSpec tests: ee/spec/config/metrics/every_metric_definition_spec.rb
Related FOSS RSpec tests:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.