2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :ci_processable, class: 'Ci::Processable' do
|
|
|
|
name { 'processable' }
|
|
|
|
stage { 'test' }
|
2023-01-13 00:05:48 +05:30
|
|
|
stage_idx { ci_stage.try(:position) || 0 }
|
2021-03-11 19:13:27 +05:30
|
|
|
ref { 'master' }
|
|
|
|
tag { false }
|
|
|
|
pipeline factory: :ci_pipeline
|
|
|
|
project { pipeline.project }
|
|
|
|
scheduling_type { 'stage' }
|
|
|
|
|
|
|
|
trait :waiting_for_resource do
|
|
|
|
status { 'waiting_for_resource' }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :resource_group do
|
|
|
|
waiting_for_resource_at { 5.minutes.ago }
|
|
|
|
|
|
|
|
after(:build) do |processable, evaluator|
|
|
|
|
processable.resource_group = create(:ci_resource_group, project: processable.project)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|