Commit db1fcb06 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa-e2e-secure-sast-tests' into 'master'

Added E2E tests for SAST reports

Closes gitlab-org/quality/testcases#124 and gitlab-org/quality/testcases#131

See merge request gitlab-org/gitlab-ee!16415
parents 96313e86 a62dc11a
......@@ -24,3 +24,13 @@ container_scanning:
artifacts:
reports:
container_scanning: gl-container-scanning-report.json
sast:
tags:
- qa
- test
script:
- echo "Skipped"
artifacts:
reports:
sast: gl-sast-report.json
This diff is collapsed.
......@@ -5,7 +5,7 @@ require 'pathname'
module QA
context 'Secure', :docker do
describe 'Security Reports in a Merge Request' do
let(:total_vuln_count) { 12 }
let(:total_vuln_count) { 45 }
after do
Service::Runner.new(@executor).remove!
......
......@@ -10,6 +10,8 @@ module QA
let(:dependency_scan_example_vuln) { 'jQuery before 3.4.0' }
let(:container_scan_vuln_count) { 8 }
let(:container_scan_example_vuln) { 'CVE-2017-18269 in glibc' }
let(:sast_scan_vuln_count) { 33 }
let(:sast_scan_example_vuln) { 'Cipher with no integrity' }
describe 'Security Reports' do
after do
......@@ -64,6 +66,11 @@ module QA
expect(pipeline).to have_vulnerability_count_of container_scan_vuln_count
expect(pipeline).to have_content container_scan_example_vuln
end
filter_report_and_perform(pipeline, "SAST") do
expect(pipeline).to have_vulnerability_count_of sast_scan_vuln_count
expect(pipeline).to have_content sast_scan_example_vuln
end
end
end
......@@ -79,6 +86,10 @@ module QA
filter_report_and_perform(dashboard, "Container Scanning") do
expect(dashboard).to have_low_vulnerability_count_of 2
end
filter_report_and_perform(dashboard, "SAST") do
expect(dashboard).to have_low_vulnerability_count_of 17
end
end
end
......@@ -99,6 +110,10 @@ module QA
filter_report_and_perform(dashboard, "Container Scanning") do
expect(dashboard).to have_content container_scan_example_vuln
end
filter_report_and_perform(dashboard, "SAST") do
expect(dashboard).to have_content sast_scan_example_vuln
end
end
end
......
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