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
e2a3b262
Commit
e2a3b262
authored
Nov 09, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests description
parent
47d85cc2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
ee/spec/lib/ee/gitlab/usage_data_counters/hll_redis_counter_spec.rb
...b/ee/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+1
-1
lib/gitlab/usage_data_counters/hll_redis_counter.rb
lib/gitlab/usage_data_counters/hll_redis_counter.rb
+1
-1
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
.../lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+1
-1
No files found.
ee/spec/lib/ee/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
e2a3b262
...
...
@@ -90,7 +90,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
end
end
context
'with
empty
invalid context'
do
context
'with invalid context'
do
it
'raise error'
do
expect
{
described_class
.
unique_events
(
event_names:
context_event
,
start_date:
4
.
weeks
.
ago
,
end_date:
Date
.
current
,
context:
invalid_context
)
}.
to
raise_error
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
InvalidContext
)
end
...
...
lib/gitlab/usage_data_counters/hll_redis_counter.rb
View file @
e2a3b262
...
...
@@ -49,7 +49,7 @@ module Gitlab
def
track_event_in_context
(
value
,
event_name
,
context
,
time
=
Time
.
zone
.
now
)
return
if
context
.
blank?
return
if
context
.
present?
&&
!
context
.
in?
(
valid_context_list
)
return
unless
context
.
in?
(
valid_context_list
)
track
(
value
,
event_name
,
context:
context
,
time:
time
)
end
...
...
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
e2a3b262
...
...
@@ -319,7 +319,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
end
end
context
'with
empty
invalid context'
do
context
'with invalid context'
do
it
'raise error'
do
expect
{
described_class
.
unique_events
(
event_names:
'event_name_1'
,
start_date:
4
.
weeks
.
ago
,
end_date:
Date
.
current
,
context:
invalid_context
)
}.
to
raise_error
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
InvalidContext
)
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