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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2e54454e
Commit
2e54454e
authored
Nov 24, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add limit to the number of events showed in cycle analytics and spec
parent
178626ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
bin/changelog
bin/changelog
+2
-0
changelogs/unreleased/fix-cycle-analytics-events-limit.yml
changelogs/unreleased/fix-cycle-analytics-events-limit.yml
+4
-0
spec/lib/gitlab/cycle_analytics/events_query_spec.rb
spec/lib/gitlab/cycle_analytics/events_query_spec.rb
+35
-0
No files found.
bin/changelog
View file @
2e54454e
...
...
@@ -80,6 +80,8 @@ class ChangelogEntry
unless
options
.
dry_run
write
%x{git add
#{
file_path
}
}
amend_commit
if
options
.
amend
end
end
...
...
changelogs/unreleased/fix-cycle-analytics-events-limit.yml
0 → 100644
View file @
2e54454e
---
title
:
Add limit to the number of events showed in cycle analytics
merge_request
:
author
:
spec/lib/gitlab/cycle_analytics/events_query_spec.rb
0 → 100644
View file @
2e54454e
require
'spec_helper'
describe
Gitlab
::
CycleAnalytics
::
EventsQuery
do
let
(
:max_events
)
{
3
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:options
)
{
{
from:
30
.
days
.
ago
}
}
let
(
:issue_event
)
do
Gitlab
::
CycleAnalytics
::
IssueEvent
.
new
(
project:
project
,
options:
options
)
end
subject
{
described_class
.
new
(
project:
project
,
options:
options
).
execute
(
issue_event
)
}
before
do
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
(
Issue
.
all
)
stub_const
(
'Gitlab::CycleAnalytics::EventsQuery::MAX_EVENTS'
,
max_events
)
setup_events
(
count:
5
)
end
it
'limits the rows the max number'
do
expect
(
subject
.
count
).
to
eq
(
max_events
)
end
def
setup_events
(
count
:)
count
.
times
do
issue
=
create
(
:issue
,
project:
project
,
created_at:
2
.
days
.
ago
)
milestone
=
create
(
:milestone
,
project:
project
)
issue
.
update
(
milestone:
milestone
)
create_merge_request_closing_issue
(
issue
)
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