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>2020-10-20 15:08:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-20 15:08:54 +0300
commitbe2142bf5e03af8ba9bb96e4bf0b4781184ae01b (patch)
treeb40aab281b29a56bd398757564d271c8b3aa8662 /spec/services/alert_management
parentbc12365ae0254332f97299138f019bea3ff12351 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/alert_management')
-rw-r--r--spec/services/alert_management/process_prometheus_alert_service_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/services/alert_management/process_prometheus_alert_service_spec.rb b/spec/services/alert_management/process_prometheus_alert_service_spec.rb
index ad4ab26c198..ae0b8d6d7ac 100644
--- a/spec/services/alert_management/process_prometheus_alert_service_spec.rb
+++ b/spec/services/alert_management/process_prometheus_alert_service_spec.rb
@@ -117,15 +117,19 @@ RSpec.describe AlertManagement::ProcessPrometheusAlertService do
end
context 'when alert cannot be created' do
+ let(:errors) { double(messages: { hosts: ['hosts array is over 255 chars'] })}
+
before do
- payload['annotations']['title'] = 'description' * 50
+ allow(service).to receive(:alert).and_call_original
+ allow(service).to receive_message_chain(:alert, :save).and_return(false)
+ allow(service).to receive_message_chain(:alert, :errors).and_return(errors)
end
it 'writes a warning to the log' do
expect(Gitlab::AppLogger).to receive(:warn).with(
message: 'Unable to create AlertManagement::Alert',
project_id: project.id,
- alert_errors: { title: ["is too long (maximum is 200 characters)"] }
+ alert_errors: { hosts: ['hosts array is over 255 chars'] }
)
execute