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