diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
commit | 434a0ce52d75e13d48eac9ce83774954c7c5d48d (patch) | |
tree | de3b7a7cf1ce8b07555f28df592297c76894c90f /spec/factories/ci | |
parent | 0a0d9493ca481c56b739a3df27c31262283150fe (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc2
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/builds.rb | 6 | ||||
-rw-r--r-- | spec/factories/ci/job_artifacts.rb | 12 | ||||
-rw-r--r-- | spec/factories/ci/pipelines.rb | 8 |
3 files changed, 25 insertions, 1 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 11719e40cf2..c3d6e9d7569 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -356,6 +356,12 @@ FactoryBot.define do end end + trait :codequality_reports do + after(:build) do |build| + build.job_artifacts << create(:ci_job_artifact, :codequality, job: build) + end + end + trait :terraform_reports do after(:build) do |build| build.job_artifacts << create(:ci_job_artifact, :terraform, job: build) diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index 223184891b7..0f5ad013a64 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -245,7 +245,17 @@ FactoryBot.define do after(:build) do |artifact, evaluator| artifact.file = fixture_file_upload( - Rails.root.join('spec/fixtures/codequality/codequality.json'), 'application/json') + Rails.root.join('spec/fixtures/codequality/codeclimate.json'), 'application/json') + end + end + + trait :codequality_without_errors do + file_type { :codequality } + file_format { :raw } + + after(:build) do |artifact, evaluator| + artifact.file = fixture_file_upload( + Rails.root.join('spec/fixtures/codequality/codeclimate_without_errors.json'), 'application/json') end end diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index 14bd0ab1bc6..ea22fba37c9 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -145,6 +145,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) |