diff options
Diffstat (limited to 'spec/factories/ci/builds.rb')
-rw-r--r-- | spec/factories/ci/builds.rb | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 24abad66530..c4f9a4ce82b 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| ## @@ -314,6 +296,18 @@ FactoryBot.define do end end + trait :sast_report do + after(:build) do |build| + build.job_artifacts << create(:ci_job_artifact, :sast, job: build) + end + end + + trait :secret_detection_report do + after(:build) do |build| + build.job_artifacts << create(:ci_job_artifact, :secret_detection, job: build) + end + end + trait :test_reports do after(:build) do |build| build.job_artifacts << create(:ci_job_artifact, :junit, job: build) |