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