Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
352fb142
Commit
352fb142
authored
Apr 15, 2021
by
Saikat Sarkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs for store_report_service_spec
parent
20d963cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
ee/spec/services/security/store_report_service_spec.rb
ee/spec/services/security/store_report_service_spec.rb
+17
-13
No files found.
ee/spec/services/security/store_report_service_spec.rb
View file @
352fb142
...
...
@@ -15,10 +15,17 @@ RSpec.describe Security::StoreReportService, '#execute' do
subject
{
described_class
.
new
(
pipeline
,
report
).
execute
}
where
(
vulnerability_finding_signatures_enabled:
[
true
,
false
])
where
(
:vulnerability_finding_signatures_enabled
,
:optimize_sql_query_for_security_report_ff
)
do
true
|
true
true
|
false
false
|
true
false
|
false
end
with_them
do
before
do
stub_feature_flags
(
vulnerability_finding_signatures:
vulnerability_finding_signatures_enabled
)
stub_feature_flags
(
optimize_sql_query_for_security_report:
optimize_sql_query_for_security_report_ff
)
stub_licensed_features
(
sast:
true
,
dependency_scanning:
true
,
container_scanning:
true
,
security_dashboard:
true
)
allow
(
Security
::
AutoFixWorker
).
to
receive
(
:perform_async
)
end
...
...
@@ -35,18 +42,14 @@ RSpec.describe Security::StoreReportService, '#execute' do
end
context
'for different security reports'
do
with_them
do
before
do
stub_feature_flags
(
optimize_sql_query_for_security_report:
optimize_sql_query_for_security_report_ff
)
end
where
(
:case_name
,
:trait
,
:scanners
,
:identifiers
,
:findings
,
:finding_identifiers
,
:finding_pipelines
,
:remediations
,
:signatures
)
do
'with SAST report'
|
:sast
|
1
|
6
|
5
|
7
|
5
|
0
|
2
'with exceeding identifiers'
|
:with_exceeding_identifiers
|
1
|
20
|
1
|
20
|
1
|
0
|
1
'with Dependency Scanning report'
|
:dependency_scanning_remediation
|
1
|
3
|
2
|
3
|
2
|
1
|
2
'with Container Scanning report'
|
:container_scanning
|
1
|
8
|
8
|
8
|
8
|
0
|
8
'with exceeding identifiers'
|
:with_exceeding_identifiers
|
1
|
20
|
1
|
20
|
1
|
0
|
0
'with Dependency Scanning report'
|
:dependency_scanning_remediation
|
1
|
3
|
2
|
3
|
2
|
1
|
0
'with Container Scanning report'
|
:container_scanning
|
1
|
8
|
8
|
8
|
8
|
0
|
0
end
with_them
do
it
'inserts all scanners'
do
expect
{
subject
}.
to
change
{
Vulnerabilities
::
Scanner
.
count
}.
by
(
scanners
)
end
...
...
@@ -76,7 +79,8 @@ RSpec.describe Security::StoreReportService, '#execute' do
end
it
'inserts all signatures'
do
expect
{
subject
}.
to
change
{
Vulnerabilities
::
FindingSignature
.
count
}.
by
(
signatures
)
signatures_count
=
vulnerability_finding_signatures_enabled
?
signatures
:
0
expect
{
subject
}.
to
change
{
Vulnerabilities
::
FindingSignature
.
count
}.
by
(
signatures_count
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment