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
13f37264
Commit
13f37264
authored
May 27, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rephrase specs description for cycle analytics
parent
ee92accc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
app/serializers/analytics_stage_entity.rb
app/serializers/analytics_stage_entity.rb
+1
-1
changelogs/unreleased/30138-display-cycle-analytics-issue.yml
...gelogs/unreleased/30138-display-cycle-analytics-issue.yml
+1
-1
spec/serializers/analytics_stage_serializer_spec.rb
spec/serializers/analytics_stage_serializer_spec.rb
+5
-5
No files found.
app/serializers/analytics_stage_entity.rb
View file @
13f37264
...
...
@@ -11,6 +11,6 @@ class AnalyticsStageEntity < Grape::Entity
expose
:median
,
as: :value
do
|
stage
|
# median returns a BatchLoader instance which we first have to unwrap by using to_f
# we use to_f to make sure results below 1 are presented to the end-user
!
stage
.
median
.
to_f
.
zero?
?
distance_of_time_in_words
(
stage
.
median
)
:
nil
stage
.
median
.
to_f
.
non
zero?
?
distance_of_time_in_words
(
stage
.
median
)
:
nil
end
end
changelogs/unreleased/30138-display-cycle-analytics-issue.yml
View file @
13f37264
---
title
:
Display improvements for cycle analytics - stop casting to integers
title
:
Show data on Cycle Analytics page when value is less than a second
merge_request
:
28507
author
:
type
:
fixed
spec/serializers/analytics_stage_serializer_spec.rb
View file @
13f37264
...
...
@@ -27,7 +27,7 @@ describe AnalyticsStageSerializer do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
BaseStage
).
to
receive
(
:median
).
and_return
(
0
)
end
it
'
value is
nil'
do
it
'
sets the value to
nil'
do
expect
(
subject
.
fetch
(
:value
)).
to
be_nil
end
end
...
...
@@ -37,18 +37,18 @@ describe AnalyticsStageSerializer do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
BaseStage
).
to
receive
(
:median
).
and_return
(
0.12
)
end
it
'
value is
equal to median'
do
it
'
sets the value to
equal to median'
do
expect
(
subject
.
fetch
(
:value
)).
to
eq
(
'less than a minute'
)
end
end
context
'when median is above 1'
do
before
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
BaseStage
).
to
receive
(
:median
).
and_return
(
1
.12
)
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
BaseStage
).
to
receive
(
:median
).
and_return
(
60
.12
)
end
it
'
value is
equal to median'
do
expect
(
subject
.
fetch
(
:value
)).
to
eq
(
'
less than a
minute'
)
it
'
sets the value to
equal to median'
do
expect
(
subject
.
fetch
(
:value
)).
to
eq
(
'
1
minute'
)
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