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
a763dec9
Commit
a763dec9
authored
Jan 08, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for N+1 queries
parent
b8b01a03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
.../populate_finding_uuid_for_vulnerability_feedback_spec.rb
+5
-0
No files found.
spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
View file @
a763dec9
...
...
@@ -86,5 +86,10 @@ RSpec.describe Gitlab::BackgroundMigration::PopulateFindingUuidForVulnerabilityF
expect
(
Gitlab
::
BackgroundMigration
::
Logger
).
to
have_received
(
:info
).
once
end
it
'preloads the finding and identifier records to prevent N+1 queries'
do
# 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
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