diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-22 12:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-22 12:08:09 +0300 |
commit | 4a3ba3e5f261eb09e6b2b4fd44373e7a1c454a72 (patch) | |
tree | 1a94467252ebcc5575c7de6a3590360ce05b9967 /spec/workers/incident_management | |
parent | 707c0eca50cf9a5290806ce637be30f4c7288def (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/incident_management')
-rw-r--r-- | spec/workers/incident_management/process_alert_worker_spec.rb | 6 | ||||
-rw-r--r-- | spec/workers/incident_management/process_prometheus_alert_worker_spec.rb | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/spec/workers/incident_management/process_alert_worker_spec.rb b/spec/workers/incident_management/process_alert_worker_spec.rb index 938e72aa0f0..08acee264f8 100644 --- a/spec/workers/incident_management/process_alert_worker_spec.rb +++ b/spec/workers/incident_management/process_alert_worker_spec.rb @@ -70,11 +70,7 @@ describe IncidentManagement::ProcessAlertWorker do end context 'when alert cannot be updated' do - before do - # invalidate alert - too_many_hosts = Array.new(AlertManagement::Alert::HOSTS_MAX_LENGTH + 1) { |_| 'host' } - alert.update_columns(hosts: too_many_hosts) - end + let(:alert) { create(:alert_management_alert, :with_validation_errors, project: project) } it 'updates AlertManagement::Alert#issue_id' do expect { subject }.not_to change { alert.reload.issue_id } diff --git a/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb b/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb index 5fbc39cad4e..d80365cfba4 100644 --- a/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb +++ b/spec/workers/incident_management/process_prometheus_alert_worker_spec.rb @@ -6,7 +6,7 @@ describe IncidentManagement::ProcessPrometheusAlertWorker do describe '#perform' do let_it_be(:project) { create(:project) } let_it_be(:prometheus_alert) { create(:prometheus_alert, project: project) } - let_it_be(:payload_key) { PrometheusAlertEvent.payload_key_for(prometheus_alert.prometheus_metric_id, prometheus_alert.created_at.rfc3339) } + let(:payload_key) { Gitlab::Alerting::Alert.new(project: project, payload: alert_params).gitlab_fingerprint } let!(:prometheus_alert_event) { create(:prometheus_alert_event, prometheus_alert: prometheus_alert, payload_key: payload_key) } let(:alert_params) do @@ -107,7 +107,6 @@ describe IncidentManagement::ProcessPrometheusAlertWorker do let(:starts_at) { Time.now.rfc3339 } let!(:prometheus_alert_event) do - payload_key = SelfManagedPrometheusAlertEvent.payload_key_for(starts_at, alert_name, 'vector(1)') create(:self_managed_prometheus_alert_event, project: project, payload_key: payload_key) end |