Commit 91e9c320 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'spec-merge_reports_service-location' into 'master'

Add MergeReportsService spec for location deduplication

See merge request gitlab-org/gitlab!59595
parents fd5be673 0d9b4046
...@@ -40,6 +40,15 @@ RSpec.describe Security::MergeReportsService, '#execute' do ...@@ -40,6 +40,15 @@ RSpec.describe Security::MergeReportsService, '#execute' do
) )
end end
let(:finding_id_2_loc_1_extra) do
build(:ci_reports_security_finding,
identifiers: [identifier_2_primary, identifier_2_cve],
location: build(:ci_reports_security_locations_sast, start_line: 32, end_line: 34),
scanner: scanner_2,
severity: :medium
)
end
let(:finding_id_2_loc_2) do let(:finding_id_2_loc_2) do
build(:ci_reports_security_finding, build(:ci_reports_security_finding,
identifiers: [identifier_2_primary, identifier_2_cve], identifiers: [identifier_2_primary, identifier_2_cve],
...@@ -81,7 +90,7 @@ RSpec.describe Security::MergeReportsService, '#execute' do ...@@ -81,7 +90,7 @@ RSpec.describe Security::MergeReportsService, '#execute' do
) )
end end
let(:report_1_findings) { [finding_id_1, finding_id_2_loc_1, finding_cwe_2, finding_wasc_1] } let(:report_1_findings) { [finding_id_1, finding_id_2_loc_1, finding_id_2_loc_1_extra, finding_cwe_2, finding_wasc_1] }
let(:scanned_resource) do let(:scanned_resource) do
::Gitlab::Ci::Reports::Security::ScannedResource.new(URI.parse('example.com'), 'GET') ::Gitlab::Ci::Reports::Security::ScannedResource.new(URI.parse('example.com'), 'GET')
......
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