diff options
author | Ryan Cobb <rcobb@gitlab.com> | 2019-06-27 12:11:55 -0700 |
---|---|---|
committer | Ryan Cobb <rcobb@gitlab.com> | 2019-07-09 17:02:07 -0600 |
commit | 9aad4174e052ba330fdaf4abc0276d8497c7de03 (patch) | |
tree | f2abafa8765b09bb1eadc2c4d7dde1658ae18c05 /spec/db | |
parent | ee1cffcf5433475266168ed43dbaa4a032721a09 (diff) | |
download | gitlab-ce-9aad4174e052ba330fdaf4abc0276d8497c7de03.tar.gz |
Refactor common metrics importer
This refactors common metrics importer for two reasons. 1. To create a
new pattern that can be followed by future importers that will minimize
dependency collision and 2. To allow EE to more easily extend
dependencies.
Diffstat (limited to 'spec/db')
-rw-r--r-- | spec/db/importers/common_metrics_importer_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/db/importers/common_metrics_importer_spec.rb b/spec/db/importers/common_metrics_importer_spec.rb index a717c8cd04d..c47effa6803 100644 --- a/spec/db/importers/common_metrics_importer_spec.rb +++ b/spec/db/importers/common_metrics_importer_spec.rb @@ -3,9 +3,9 @@ require 'rails_helper' require Rails.root.join("db", "importers", "common_metrics_importer.rb") -describe Importers::PrometheusMetric do +describe Importers::CommonMetrics::PrometheusMetric do let(:existing_group_titles) do - ::PrometheusMetric::GROUP_DETAILS.each_with_object({}) do |(key, value), memo| + ::PrometheusMetricEnums.group_details.each_with_object({}) do |(key, value), memo| memo[key] = value[:group_title] end end @@ -15,7 +15,7 @@ describe Importers::PrometheusMetric do end it 'GROUP_TITLES equals ::PrometheusMetric' do - expect(described_class::GROUP_TITLES).to eq(existing_group_titles) + expect(Importers::CommonMetrics::PrometheusMetricEnums.group_titles).to eq(existing_group_titles) end end @@ -104,7 +104,7 @@ describe Importers::CommonMetricsImporter do let(:query_identifier) { } it 'raises exception' do - expect { subject.execute }.to raise_error(described_class::MissingQueryId) + expect { subject.execute }.to raise_error(Importers::CommonMetrics::Importer::MissingQueryId) end end |