Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-11 15:12:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-11 15:12:30 +0300
commit0b54f87a31c23544ca5917bf772ce9c64a61562c (patch)
tree79d56df6750e84fd4a10205d9dcce293f7c5d491 /spec/features/markdown
parente348fb4c1b9eaf21655001dc4346ceb0c0c3d5b4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown')
-rw-r--r--spec/features/markdown/metrics_spec.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb
index 9f00bb99c0d..1b68f78e993 100644
--- a/spec/features/markdown/metrics_spec.rb
+++ b/spec/features/markdown/metrics_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_store_caching, :sidekiq_inline, feature_category: :team_planning do
+RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_store_caching, :sidekiq_inline, feature_category: :metrics do
include PrometheusHelpers
include KubernetesHelpers
include GrafanaApiHelpers
@@ -29,6 +29,20 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
clear_host_from_memoized_variables
end
+ shared_examples_for 'metrics dashboard unavailable' do
+ context 'when metrics dashboard feature is unavailable' do
+ before do
+ stub_feature_flags(remove_monitor_metrics: true)
+ end
+
+ it 'shows no embedded metrics' do
+ visit project_issue_path(project, issue)
+
+ expect(page).to have_no_css('div.prometheus-graph')
+ end
+ end
+ end
+
context 'internal metrics embeds' do
before do
import_common_metrics
@@ -37,6 +51,8 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
allow(Prometheus::ProxyService).to receive(:new).and_call_original
end
+ include_examples 'metrics dashboard unavailable'
+
it 'shows embedded metrics' do
visit project_issue_path(project, issue)
@@ -135,6 +151,8 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
allow(Grafana::ProxyService).to receive(:new).and_call_original
end
+ include_examples 'metrics dashboard unavailable'
+
it 'shows embedded metrics', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/402973' do
visit project_issue_path(project, issue)
@@ -172,6 +190,8 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
stub_any_prometheus_request_with_response
end
+ include_examples 'metrics dashboard unavailable'
+
it 'shows embedded metrics' do
visit project_issue_path(project, issue)
@@ -201,6 +221,8 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
let(:metrics_url) { urls.namespace_project_cluster_url(*params, **query_params) }
let(:description) { "# Summary \n[](#{metrics_url})" }
+ include_examples 'metrics dashboard unavailable'
+
it 'shows embedded metrics' do
visit project_issue_path(project, issue)