2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2020-01-09 13:07:52 -05:00
|
|
|
factory :commit_status, class: 'CommitStatus' do
|
2019-10-01 20:06:26 -04:00
|
|
|
name { 'default' }
|
|
|
|
stage { 'test' }
|
|
|
|
stage_idx { 0 }
|
|
|
|
status { 'success' }
|
|
|
|
description { 'commit status'}
|
2019-11-13 07:06:22 -05:00
|
|
|
pipeline factory: :ci_pipeline
|
2019-10-01 20:06:26 -04:00
|
|
|
started_at { 'Tue, 26 Jan 2016 08:21:42 +0100'}
|
|
|
|
finished_at { 'Tue, 26 Jan 2016 08:23:42 +0100'}
|
2016-01-26 02:32:36 -05:00
|
|
|
|
2016-08-11 09:22:35 -04:00
|
|
|
trait :success do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'success' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :failed do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'failed' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :canceled do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'canceled' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
2016-11-18 12:02:49 -05:00
|
|
|
trait :skipped do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'skipped' }
|
2016-11-18 12:02:49 -05:00
|
|
|
end
|
|
|
|
|
2016-08-11 09:22:35 -04:00
|
|
|
trait :running do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'running' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :pending do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'pending' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
2019-12-24 07:08:01 -05:00
|
|
|
trait :waiting_for_resource do
|
|
|
|
status { 'waiting_for_resource' }
|
|
|
|
end
|
|
|
|
|
2019-02-26 21:13:06 -05:00
|
|
|
trait :preparing do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'preparing' }
|
2019-02-26 21:13:06 -05:00
|
|
|
end
|
|
|
|
|
2016-08-11 09:22:35 -04:00
|
|
|
trait :created do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'created' }
|
2016-08-11 09:22:35 -04:00
|
|
|
end
|
|
|
|
|
2017-03-06 07:54:29 -05:00
|
|
|
trait :manual do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'manual' }
|
2017-03-06 07:54:29 -05:00
|
|
|
end
|
|
|
|
|
2018-09-26 07:21:36 -04:00
|
|
|
trait :scheduled do
|
2019-10-01 20:06:26 -04:00
|
|
|
status { 'scheduled' }
|
2018-09-26 07:21:36 -04:00
|
|
|
end
|
|
|
|
|
2016-01-26 02:32:36 -05:00
|
|
|
after(:build) do |build, evaluator|
|
2016-06-03 07:09:49 -04:00
|
|
|
build.project = build.pipeline.project
|
2016-01-26 02:32:36 -05:00
|
|
|
end
|
2015-10-06 06:01:16 -04:00
|
|
|
|
2020-01-09 13:07:52 -05:00
|
|
|
factory :generic_commit_status, class: 'GenericCommitStatus' do
|
2019-10-01 20:06:26 -04:00
|
|
|
name { 'generic' }
|
|
|
|
description { 'external commit status' }
|
2015-10-06 06:01:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|