2019-07-25 05:11:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-29 08:43:32 +00:00
|
|
|
FactoryBot.define do
|
2020-01-09 18:07:52 +00:00
|
|
|
factory :ci_build_trace_chunk, class: 'Ci::BuildTraceChunk' do
|
2018-04-30 05:52:29 +00:00
|
|
|
build factory: :ci_build
|
2019-10-02 00:06:26 +00:00
|
|
|
chunk_index { 0 }
|
|
|
|
data_store { :redis }
|
2018-06-25 10:46:38 +00:00
|
|
|
|
|
|
|
trait :redis_with_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :redis }
|
2018-06-25 10:46:38 +00:00
|
|
|
|
|
|
|
transient do
|
2019-10-02 00:06:26 +00:00
|
|
|
initial_data { 'test data' }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
after(:create) do |build_trace_chunk, evaluator|
|
2018-07-04 06:19:22 +00:00
|
|
|
Ci::BuildTraceChunks::Redis.new.set_data(build_trace_chunk, evaluator.initial_data)
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :redis_without_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :redis }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :database_with_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :database}
|
2018-06-25 10:46:38 +00:00
|
|
|
|
|
|
|
transient do
|
2019-10-02 00:06:26 +00:00
|
|
|
initial_data { 'test data' }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
after(:build) do |build_trace_chunk, evaluator|
|
2018-07-04 06:19:22 +00:00
|
|
|
Ci::BuildTraceChunks::Database.new.set_data(build_trace_chunk, evaluator.initial_data)
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :database_without_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :database }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :fog_with_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :fog }
|
2018-06-25 10:46:38 +00:00
|
|
|
|
|
|
|
transient do
|
2019-10-02 00:06:26 +00:00
|
|
|
initial_data { 'test data' }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
after(:create) do |build_trace_chunk, evaluator|
|
2018-07-04 06:19:22 +00:00
|
|
|
Ci::BuildTraceChunks::Fog.new.set_data(build_trace_chunk, evaluator.initial_data)
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :fog_without_data do
|
2019-10-02 00:06:26 +00:00
|
|
|
data_store { :fog }
|
2018-06-25 10:46:38 +00:00
|
|
|
end
|
2018-03-29 08:43:32 +00:00
|
|
|
end
|
|
|
|
end
|