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
1e0bd1ac
Commit
1e0bd1ac
authored
Feb 06, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a flaky example in pipelines_controller_spec
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
d1613be7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+11
-5
No files found.
spec/controllers/projects/pipelines_controller_spec.rb
View file @
1e0bd1ac
...
...
@@ -29,7 +29,7 @@ describe Projects::PipelinesController do
stub_feature_flags
(
ci_pipeline_persisted_stages:
true
)
end
it
'returns serialized pipelines'
,
:request_store
do
it
'returns serialized pipelines'
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
get_pipelines_index_json
...
...
@@ -60,7 +60,6 @@ describe Projects::PipelinesController do
# There appears to be one extra query for Pipelines#has_warnings? for some reason
expect
{
get_pipelines_index_json
}.
not_to
exceed_query_limit
(
control_count
+
1
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'pipelines'
].
count
).
to
eq
10
end
...
...
@@ -90,11 +89,18 @@ describe Projects::PipelinesController do
end
it
'does not execute N+1 queries'
do
queries
=
ActiveRecord
::
QueryRecorder
.
new
do
get_pipelines_index_json
control_count
=
ActiveRecord
::
QueryRecorder
.
new
do
get_pipelines_index_json
end
end
.
count
expect
(
queries
.
count
).
to
be
<=
36
create_all_pipeline_types
# There appears to be one extra query for Pipelines#has_warnings? for some reason
expect
{
get_pipelines_index_json
}.
not_to
exceed_query_limit
(
control_count
+
1
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'pipelines'
].
count
).
to
eq
10
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