diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/factories/ci/pipelines.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/factories/ci/pipelines.rb')
-rw-r--r-- | spec/factories/ci/pipelines.rb | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index 14bd0ab1bc6..86a8b008e48 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -16,6 +16,7 @@ FactoryBot.define do transient { head_pipeline_of { nil } } transient { child_of { nil } } + transient { upstream_of { nil } } after(:build) do |pipeline, evaluator| if evaluator.child_of @@ -30,9 +31,12 @@ FactoryBot.define do if evaluator.child_of bridge = create(:ci_bridge, pipeline: evaluator.child_of) - create(:ci_sources_pipeline, - source_job: bridge, - pipeline: pipeline) + create(:ci_sources_pipeline, source_job: bridge, pipeline: pipeline) + end + + if evaluator.upstream_of + bridge = create(:ci_bridge, pipeline: pipeline) + create(:ci_sources_pipeline, source_job: bridge, pipeline: evaluator.upstream_of) end end @@ -122,10 +126,10 @@ FactoryBot.define do end trait :with_test_reports_with_three_failures do - status { :success } + status { :failed } after(:build) do |pipeline, _evaluator| - pipeline.builds << build(:ci_build, :test_reports_with_three_failures, pipeline: pipeline, project: pipeline.project) + pipeline.builds << build(:ci_build, :failed, :test_reports_with_three_failures, pipeline: pipeline, project: pipeline.project) end end @@ -145,6 +149,14 @@ FactoryBot.define do end end + trait :with_codequality_reports do + status { :success } + + after(:build) do |pipeline, evaluator| + pipeline.builds << build(:ci_build, :codequality_reports, pipeline: pipeline, project: pipeline.project) + end + end + trait :with_coverage_report_artifact do after(:build) do |pipeline, evaluator| pipeline.pipeline_artifacts << build(:ci_pipeline_artifact, pipeline: pipeline, project: pipeline.project) |