diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/services/projects/prometheus/alerts | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/services/projects/prometheus/alerts')
-rw-r--r-- | spec/services/projects/prometheus/alerts/notify_service_spec.rb | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/spec/services/projects/prometheus/alerts/notify_service_spec.rb b/spec/services/projects/prometheus/alerts/notify_service_spec.rb index bfc8225b654..5235c64d451 100644 --- a/spec/services/projects/prometheus/alerts/notify_service_spec.rb +++ b/spec/services/projects/prometheus/alerts/notify_service_spec.rb @@ -45,9 +45,9 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do end before do - create(:clusters_applications_prometheus, :installed, + create(:clusters_integrations_prometheus, cluster: prd_cluster, alert_manager_token: token) - create(:clusters_applications_prometheus, :installed, + create(:clusters_integrations_prometheus, cluster: stg_cluster, alert_manager_token: nil) end @@ -62,41 +62,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do end end - context 'with project specific cluster using prometheus application' do - where(:cluster_enabled, :status, :configured_token, :token_input, :result) do - true | :installed | token | token | :success - true | :installed | nil | nil | :success - true | :updated | token | token | :success - true | :updating | token | token | :failure - true | :installed | token | 'x' | :failure - true | :installed | nil | token | :failure - true | :installed | token | nil | :failure - true | nil | token | token | :failure - false | :installed | token | token | :failure - end - - with_them do - before do - cluster.update!(enabled: cluster_enabled) - - if status - create(:clusters_applications_prometheus, status, - cluster: cluster, - alert_manager_token: configured_token) - end - end - - case result = params[:result] - when :success - include_examples 'processes one firing and one resolved prometheus alerts' - when :failure - it_behaves_like 'alerts service responds with an error and takes no actions', :unauthorized - else - raise "invalid result: #{result.inspect}" - end - end - end - context 'with project specific cluster using prometheus integration' do where(:cluster_enabled, :integration_enabled, :configured_token, :token_input, :result) do true | true | token | token | :success |