Commit e310120e authored by Sean McGivern's avatar Sean McGivern

Merge branch 'pl-fix-alert-serialization' into 'master'

Fix alert serialization when opening incidents

See merge request gitlab-org/gitlab-ee!10254
parents 99d94583 68168569
...@@ -133,7 +133,7 @@ module Projects ...@@ -133,7 +133,7 @@ module Projects
def process_incident_issues def process_incident_issues
firings.each do |alert| firings.each do |alert|
IncidentManagement::ProcessAlertWorker IncidentManagement::ProcessAlertWorker
.perform_async(project.id, alert) .perform_async(project.id, alert.to_h)
end end
end end
......
...@@ -29,18 +29,20 @@ describe Projects::Prometheus::Alerts::NotifyService do ...@@ -29,18 +29,20 @@ describe Projects::Prometheus::Alerts::NotifyService do
end end
end end
shared_examples 'processes incident issues' do |amount| shared_examples 'processes incident issues', :sidekiq do |amount|
let(:create_incident_service) { spy } let(:create_incident_service) { spy }
it 'processes issues' do it 'processes issues' do
expect(IncidentManagement::ProcessAlertWorker) expect(IncidentManagement::ProcessAlertWorker)
.to receive(:perform_async) .to receive(:perform_async)
.with(project.id, anything) .with(project.id, kind_of(Hash))
.exactly(amount).times .exactly(amount).times
Sidekiq::Testing.inline! do
expect(subject).to eq(true) expect(subject).to eq(true)
end end
end end
end
shared_examples 'does not process incident issues' do shared_examples 'does not process incident issues' do
it 'does not process issues' do it 'does not process issues' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment