Commit 19f2d1bb authored by Kamil Trzciński's avatar Kamil Trzciński

Add all missing report types

parent 71601000
......@@ -6,7 +6,7 @@ FactoryBot.define do
failure_reason { Ci::Build.failure_reasons[:protected_environment_failure] }
end
%i[sast performance license_management].each do |report_type|
%i[sast codequality dependency_scanning container_scanning dast performance license_management].each do |report_type|
trait "legacy_#{report_type}".to_sym do
success
artifacts
......
......@@ -41,5 +41,35 @@ FactoryBot.define do
Rails.root.join('spec/fixtures/trace/sample_trace'), 'text/plain')
end
end
trait :dependency_scanning do
file_format :raw
file_type :dependency_scanning
after(:build) do |artifact, _|
artifact.file = fixture_file_upload(
Rails.root.join('spec/fixtures/security-reports/master/gl-dependency-scanning-report.json'), 'text/plain')
end
end
trait :container_scanning do
file_format :raw
file_type :container_scanning
after(:build) do |artifact, _|
artifact.file = fixture_file_upload(
Rails.root.join('spec/fixtures/security-reports/master/gl-container-scanning-report.json'), 'text/plain')
end
end
trait :dast do
file_format :raw
file_type :dast
after(:build) do |artifact, _|
artifact.file = fixture_file_upload(
Rails.root.join('spec/fixtures/security-reports/master/gl-dast-report.json'), 'text/plain')
end
end
end
end
......@@ -58,8 +58,7 @@ describe MergeRequestWidgetEntity do
context "with new report artifacts" do
before do
job = create(:ci_build, pipeline: pipeline)
create(:ci_job_artifact, file_type: artifact_type, file_format: Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS[artifact_type], job: job)
create(:ee_ci_build, artifact_type, pipeline: pipeline)
end
it "has data entry" do
......@@ -69,17 +68,7 @@ describe MergeRequestWidgetEntity do
context "with legacy report artifacts" do
before do
create(:ci_build,
:success,
:artifacts,
pipeline: pipeline,
name: artifact_type,
options: {
artifacts: {
paths: [Ci::JobArtifact::DEFAULT_FILE_NAMES[artifact_type]]
}
}
)
create(:ee_ci_build, :"legacy_#{artifact_type}", pipeline: pipeline)
end
it "has data entry" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment