debian-mirror-gitlab/spec/factories/prometheus_alert.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
445 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :prometheus_alert do
project
operator { :gt }
threshold { 1 }
environment do |alert|
2021-01-03 14:25:43 +05:30
association(:environment, project: alert.project)
2020-03-13 15:44:24 +05:30
end
prometheus_metric do |alert|
2021-01-03 14:25:43 +05:30
association(:prometheus_metric, project: alert.project)
2020-03-13 15:44:24 +05:30
end
2020-10-24 23:57:45 +05:30
trait :with_runbook_url do
runbook_url { 'https://runbooks.gitlab.com/metric_gt_1'}
end
2020-03-13 15:44:24 +05:30
end
end