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
ce53319c
Commit
ce53319c
authored
Jan 08, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for error capturing
parent
a763dec9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
.../populate_finding_uuid_for_vulnerability_feedback_spec.rb
+18
-0
No files found.
spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
View file @
ce53319c
...
...
@@ -91,5 +91,23 @@ RSpec.describe Gitlab::BackgroundMigration::PopulateFindingUuidForVulnerabilityF
# Load feedback records(1), load findings(2), load identifiers(3) and finally update feedback records one by one(6)
expect
{
populate_finding_uuids
}.
not_to
exceed_query_limit
(
6
)
end
context
'when setting the `finding_uuid` attribute of a feedback record fails'
do
let
(
:expected_error
)
{
RuntimeError
.
new
}
before
do
allow
(
Gitlab
::
ErrorTracking
).
to
receive
(
:track_and_raise_for_dev_exception
)
allow_next_found_instance_of
(
described_class
::
VulnerabilityFeedback
)
do
|
feedback
|
allow
(
feedback
).
to
receive
(
:update_column
).
and_raise
(
expected_error
)
end
end
it
'captures the errors and does not crash entirely'
do
expect
{
populate_finding_uuids
}.
not_to
raise_error
expect
(
Gitlab
::
ErrorTracking
).
to
have_received
(
:track_and_raise_for_dev_exception
).
with
(
expected_error
).
exactly
(
3
).
times
end
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