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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
45840426
Commit
45840426
authored
Nov 11, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added benchmark for IssuesFinder
parent
e4ae8b13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
spec/benchmarks/finders/issues_finder_spec.rb
spec/benchmarks/finders/issues_finder_spec.rb
+55
-0
No files found.
spec/benchmarks/finders/issues_finder_spec.rb
0 → 100644
View file @
45840426
require
'spec_helper'
describe
IssuesFinder
,
benchmark:
true
do
describe
'#execute'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:label1
)
{
create
(
:label
,
project:
project
,
title:
'A'
)
}
let
(
:label2
)
{
create
(
:label
,
project:
project
,
title:
'B'
)
}
before
do
10
.
times
do
|
n
|
issue
=
create
(
:issue
,
author:
user
,
project:
project
)
if
n
>
4
create
(
:label_link
,
label:
label1
,
target:
issue
)
create
(
:label_link
,
label:
label2
,
target:
issue
)
end
end
end
describe
'retrieving issues without labels'
do
let
(
:finder
)
do
IssuesFinder
.
new
(
user
,
scope:
'all'
,
label_name:
Label
::
None
.
title
,
state:
'opened'
)
end
benchmark_subject
{
finder
.
execute
}
it
{
is_expected
.
to
iterate_per_second
(
2000
)
}
end
describe
'retrieving issues with labels'
do
let
(
:finder
)
do
IssuesFinder
.
new
(
user
,
scope:
'all'
,
label_name:
label1
.
title
,
state:
'opened'
)
end
benchmark_subject
{
finder
.
execute
}
it
{
is_expected
.
to
iterate_per_second
(
1000
)
}
end
describe
'retrieving issues for a single project'
do
let
(
:finder
)
do
IssuesFinder
.
new
(
user
,
scope:
'all'
,
label_name:
Label
::
None
.
title
,
state:
'opened'
,
project_id:
project
.
id
)
end
benchmark_subject
{
finder
.
execute
}
it
{
is_expected
.
to
iterate_per_second
(
2000
)
}
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