2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2016-11-22 11:58:10 -05:00
|
|
|
factory :project_statistics do
|
2017-05-31 09:43:19 -04:00
|
|
|
project
|
|
|
|
|
|
|
|
initialize_with do
|
|
|
|
# statistics are automatically created when a project is created
|
|
|
|
project&.statistics || new
|
|
|
|
end
|
2019-07-02 10:44:39 -04:00
|
|
|
|
|
|
|
transient do
|
|
|
|
with_data { false }
|
|
|
|
size_multiplier { 1 }
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:build) do |project_statistics, evaluator|
|
|
|
|
if evaluator.with_data
|
|
|
|
project_statistics.repository_size = evaluator.size_multiplier
|
|
|
|
project_statistics.wiki_size = evaluator.size_multiplier * 2
|
|
|
|
project_statistics.lfs_objects_size = evaluator.size_multiplier * 3
|
|
|
|
project_statistics.build_artifacts_size = evaluator.size_multiplier * 4
|
|
|
|
project_statistics.packages_size = evaluator.size_multiplier * 5
|
2020-06-26 11:08:45 -04:00
|
|
|
project_statistics.snippets_size = evaluator.size_multiplier * 6
|
2020-08-24 08:10:17 -04:00
|
|
|
project_statistics.pipeline_artifacts_size = evaluator.size_multiplier * 7
|
2020-11-13 19:09:32 -05:00
|
|
|
project_statistics.uploads_size = evaluator.size_multiplier * 8
|
2022-04-11 23:09:50 -04:00
|
|
|
project_statistics.container_registry_size = evaluator.size_multiplier * 9
|
2019-07-02 10:44:39 -04:00
|
|
|
end
|
|
|
|
end
|
2016-11-22 11:58:10 -05:00
|
|
|
end
|
|
|
|
end
|