Commit 6063a6e9 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'fa-improve__usage_data_unique_counts_specs' into 'master'

Add missing spec for recording unique events

See merge request gitlab-org/gitlab!84951
parents 953cd553 799270d8
...@@ -296,7 +296,7 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl ...@@ -296,7 +296,7 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
end end
it_behaves_like 'a daily tracked issuable event' do it_behaves_like 'a daily tracked issuable event' do
let(:action) { described_class::ISSUE_EPIC_DESTROYED } let(:action) { described_class::EPIC_DESTROYED }
end end
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
......
...@@ -5,7 +5,7 @@ RSpec.shared_examples 'a daily tracked issuable event' do ...@@ -5,7 +5,7 @@ RSpec.shared_examples 'a daily tracked issuable event' do
stub_application_setting(usage_ping_enabled: true) stub_application_setting(usage_ping_enabled: true)
end 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) Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: action, start_date: date_from, end_date: date_to)
end end
...@@ -14,6 +14,7 @@ RSpec.shared_examples 'a daily tracked issuable event' do ...@@ -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: user1)).to be_truthy expect(track_action(author: user1)).to be_truthy
expect(track_action(author: user2)).to be_truthy expect(track_action(author: user2)).to be_truthy
expect(count_unique).to eq(2)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment