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
799270d8
Commit
799270d8
authored
Apr 12, 2022
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing spec for recording unique events
Properly test unique events recorded on shared examples.
parent
879b4703
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+1
-1
spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb
.../usage_data_counters/issuable_activity_shared_examples.rb
+2
-1
No files found.
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
799270d8
...
...
@@ -296,7 +296,7 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
ISSUE_
EPIC_DESTROYED
}
let
(
:action
)
{
described_class
::
EPIC_DESTROYED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
...
...
spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb
View file @
799270d8
...
...
@@ -5,7 +5,7 @@ RSpec.shared_examples 'a daily tracked issuable event' do
stub_application_setting
(
usage_ping_enabled:
true
)
end
def
count_unique
(
date_from
:
,
date_to
:
)
def
count_unique
(
date_from:
1
.
minute
.
ago
,
date_to:
1
.
minute
.
from_now
)
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
event_names:
action
,
start_date:
date_from
,
end_date:
date_to
)
end
...
...
@@ -14,6 +14,7 @@ RSpec.shared_examples 'a daily tracked issuable event' do
expect
(
track_action
(
author:
user1
)).
to
be_truthy
expect
(
track_action
(
author:
user1
)).
to
be_truthy
expect
(
track_action
(
author:
user2
)).
to
be_truthy
expect
(
count_unique
).
to
eq
(
2
)
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