diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 12:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 12:09:10 +0300 |
commit | 315243f87739dd1edda2b75361f826abc91d4069 (patch) | |
tree | f72b9e0c3e79e263687ea8d127a3e78bde9d8760 /spec/factories/ci | |
parent | 1c4f17276df2af5a6c205c2a3ceec907751edf68 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/bridge.rb | 9 | ||||
-rw-r--r-- | spec/factories/ci/builds.rb | 20 | ||||
-rw-r--r-- | spec/factories/ci/processable.rb | 26 |
3 files changed, 28 insertions, 27 deletions
diff --git a/spec/factories/ci/bridge.rb b/spec/factories/ci/bridge.rb index 7258b3367d3..6cbcabca7ab 100644 --- a/spec/factories/ci/bridge.rb +++ b/spec/factories/ci/bridge.rb @@ -1,17 +1,10 @@ # frozen_string_literal: true FactoryBot.define do - factory :ci_bridge, class: 'Ci::Bridge' do + factory :ci_bridge, class: 'Ci::Bridge', parent: :ci_processable do name { 'bridge' } - stage { 'test' } - stage_idx { 0 } - ref { 'master' } - tag { false } created_at { '2013-10-29 09:50:00 CET' } status { :created } - scheduling_type { 'stage' } - - pipeline factory: :ci_pipeline trait :variables do yaml_variables do diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index c85918a3187..0f4216708d2 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -3,15 +3,10 @@ include ActionDispatch::TestProcess FactoryBot.define do - factory :ci_build, class: 'Ci::Build' do + factory :ci_build, class: 'Ci::Build', parent: :ci_processable do name { 'test' } - stage { 'test' } - stage_idx { 0 } - ref { 'master' } - tag { false } add_attribute(:protected) { false } created_at { 'Di 29. Okt 09:50:00 CET 2013' } - scheduling_type { 'stage' } pending options do @@ -28,7 +23,6 @@ FactoryBot.define do ] end - pipeline factory: :ci_pipeline project { pipeline.project } trait :degenerated do @@ -79,10 +73,6 @@ FactoryBot.define do status { 'created' } end - trait :waiting_for_resource do - status { 'waiting_for_resource' } - end - trait :preparing do status { 'preparing' } end @@ -213,14 +203,6 @@ FactoryBot.define do trigger_request factory: :ci_trigger_request end - trait :resource_group do - waiting_for_resource_at { 5.minutes.ago } - - after(:build) do |build, evaluator| - build.resource_group = create(:ci_resource_group, project: build.project) - end - end - trait :with_deployment do after(:build) do |build, evaluator| ## diff --git a/spec/factories/ci/processable.rb b/spec/factories/ci/processable.rb new file mode 100644 index 00000000000..0550f4c23fa --- /dev/null +++ b/spec/factories/ci/processable.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_processable, class: 'Ci::Processable' do + name { 'processable' } + stage { 'test' } + stage_idx { 0 } + 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 |