diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 14:21:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 14:21:10 +0000 |
commit | cb0d23c455b73486fd1015f8ca9479b5b7e3585d (patch) | |
tree | d7dc129a407fd74266d2dc561bebf24665197c2f /spec/lib/gitlab/metrics/dashboard | |
parent | c3e911be175c0aabfea1eb030f9e0ef23f5f3887 (diff) | |
download | gitlab-ce-cb0d23c455b73486fd1015f8ca9479b5b7e3585d.tar.gz |
Add latest changes from gitlab-org/gitlab@12-7-stable-ee
Diffstat (limited to 'spec/lib/gitlab/metrics/dashboard')
-rw-r--r-- | spec/lib/gitlab/metrics/dashboard/processor_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb index 4fa136bc405..e186a383059 100644 --- a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb @@ -86,6 +86,16 @@ describe Gitlab::Metrics::Dashboard::Processor do expect(metrics).to eq %w(metric_b metric_a2 metric_a1) end end + + context 'when sample_metrics are requested' do + let(:process_params) { [project, dashboard_yml, sequence, { environment: environment, sample_metrics: true }] } + + it 'includes a sample metrics path for the prometheus endpoint with each metric' do + expect(all_metrics).to satisfy_all do |metric| + metric[:prometheus_endpoint_path] == sample_metrics_path(metric[:id]) + end + end + end end shared_examples_for 'errors with message' do |expected_message| @@ -147,4 +157,12 @@ describe Gitlab::Metrics::Dashboard::Processor do query: query ) end + + def sample_metrics_path(metric) + Gitlab::Routing.url_helpers.sample_metrics_project_environment_path( + project, + environment, + identifier: metric + ) + end end |