diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-26 12:11:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-26 12:11:27 +0300 |
commit | 576bba90f9b4b4fdd604871805469f57c147e07c (patch) | |
tree | e3c3bef2505f1fd1fc5e3b9928566a3ca0b9682b /spec/support/shared_examples | |
parent | 403b33efdbc038a6bd42a50970e0985b385f73d7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r-- | spec/support/shared_examples/config/metrics/every_metric_definition_shared_examples.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/support/shared_examples/config/metrics/every_metric_definition_shared_examples.rb b/spec/support/shared_examples/config/metrics/every_metric_definition_shared_examples.rb index d9c624a5747..f03a9302bca 100644 --- a/spec/support/shared_examples/config/metrics/every_metric_definition_shared_examples.rb +++ b/spec/support/shared_examples/config/metrics/every_metric_definition_shared_examples.rb @@ -126,10 +126,23 @@ RSpec.shared_examples 'every metric definition' do ].freeze end + let(:removed_classes) do + [ + Gitlab::Usage::Metrics::Instrumentations::InProductMarketingEmailCtaClickedMetric, + Gitlab::Usage::Metrics::Instrumentations::InProductMarketingEmailSentMetric + ].freeze + end + + def metric_not_used?(constant) + parent_metric_classes.include?(constant) || + ignored_classes.include?(constant) || + removed_classes.include?(constant) + end + def assert_uses_all_nested_classes(parent_module) parent_module.constants(false).each do |const_name| constant = parent_module.const_get(const_name, false) - next if parent_metric_classes.include?(constant) || ignored_classes.include?(constant) + next if metric_not_used?(constant) case constant when Class |