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
7a96fb91
Commit
7a96fb91
authored
May 07, 2021
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark n+1 tests as flaky
parent
6592e5fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+12
-4
No files found.
spec/requests/api/merge_requests_spec.rb
View file @
7a96fb91
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
require
"spec_helper"
require
"spec_helper"
RSpec
.
describe
API
::
MergeRequests
,
:with_clean_rails_cache
do
RSpec
.
describe
API
::
MergeRequests
do
include
ProjectForksHelper
include
ProjectForksHelper
let_it_be
(
:base_time
)
{
Time
.
now
}
let_it_be
(
:base_time
)
{
Time
.
now
}
...
@@ -52,7 +52,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
...
@@ -52,7 +52,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
end
end
context
'when authenticated'
do
context
'when authenticated'
do
it
'avoids N+1 queries'
,
:use_sql_query_cache
do
it
'avoids N+1 queries'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/330335'
do
control
=
ActiveRecord
::
QueryRecorder
.
new
do
control
=
ActiveRecord
::
QueryRecorder
.
new
do
get
api
(
endpoint_path
,
user
)
get
api
(
endpoint_path
,
user
)
end
end
...
@@ -142,7 +142,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
...
@@ -142,7 +142,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
expect
(
json_response
.
last
[
'labels'
].
first
).
to
match_schema
(
'/public_api/v4/label_basic'
)
expect
(
json_response
.
last
[
'labels'
].
first
).
to
match_schema
(
'/public_api/v4/label_basic'
)
end
end
it
'avoids N+1 queries'
do
it
'avoids N+1 queries'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/330335'
do
path
=
endpoint_path
+
"?with_labels_details=true"
path
=
endpoint_path
+
"?with_labels_details=true"
control
=
ActiveRecord
::
QueryRecorder
.
new
do
control
=
ActiveRecord
::
QueryRecorder
.
new
do
...
@@ -973,6 +973,14 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
...
@@ -973,6 +973,14 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
it_behaves_like
'merge requests list'
it_behaves_like
'merge requests list'
context
'when :api_caching_merge_requests is disabled'
do
before
do
stub_feature_flags
(
api_caching_merge_requests:
false
)
end
it_behaves_like
'merge requests list'
end
it
"returns 404 for non public projects"
do
it
"returns 404 for non public projects"
do
project
=
create
(
:project
,
:private
)
project
=
create
(
:project
,
:private
)
...
@@ -1049,7 +1057,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
...
@@ -1049,7 +1057,7 @@ RSpec.describe API::MergeRequests, :with_clean_rails_cache do
include_context
'with merge requests'
include_context
'with merge requests'
it
'avoids N+1 queries'
do
it
'avoids N+1 queries'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/330335'
do
control
=
ActiveRecord
::
QueryRecorder
.
new
do
control
=
ActiveRecord
::
QueryRecorder
.
new
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
)
end
.
count
end
.
count
...
...
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