Commit af5196e9 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Apply 1 suggestion(s) to 1 file(s)

parent a0ca8583
...@@ -5,12 +5,10 @@ require 'spec_helper' ...@@ -5,12 +5,10 @@ require 'spec_helper'
# If this spec fails, we need to add the new code review event to the correct aggregated metric # If this spec fails, we need to add the new code review event to the correct aggregated metric
RSpec.describe 'Code review events' do RSpec.describe 'Code review events' do
it 'the aggregated metrics contain all the code review metrics' do it 'the aggregated metrics contain all the code review metrics' do
wildcard = Gitlab::Usage::Metrics::Aggregates::AGGREGATED_METRICS_PATH path = Rails.root.join('lib/gitlab/usage_data_counters/aggregated_metrics/code_review.yml')
aggregated_events = Dir[wildcard].each_with_object([]) do |path, metrics| aggregated_events = YAML.safe_load(File.read(path), aliases: true)&.map(&:with_indifferent_access)
metrics.push(*YAML.safe_load(File.read(path), aliases: true)&.map(&:with_indifferent_access))
end
code_review_aggregated_events = aggregated_events code_review_aggregated_events = aggregated_events
.select { |event| event['name'].include?('code_review') }
.map { |event| event['events'] } .map { |event| event['events'] }
.flatten .flatten
.uniq .uniq
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment