2020-02-06 13:08:54 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :prometheus_alert do
|
|
|
|
project
|
|
|
|
operator { :gt }
|
|
|
|
threshold { 1 }
|
|
|
|
|
|
|
|
environment do |alert|
|
2020-10-20 08:08:54 -04:00
|
|
|
association(:environment, project: alert.project)
|
2020-02-06 13:08:54 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
prometheus_metric do |alert|
|
2020-10-20 08:08:54 -04:00
|
|
|
association(:prometheus_metric, project: alert.project)
|
2020-02-06 13:08:54 -05:00
|
|
|
end
|
2020-08-07 02:09:47 -04:00
|
|
|
|
|
|
|
trait :with_runbook_url do
|
|
|
|
runbook_url { 'https://runbooks.gitlab.com/metric_gt_1'}
|
|
|
|
end
|
2020-02-06 13:08:54 -05:00
|
|
|
end
|
|
|
|
end
|