diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/support/shared_examples/requests/api/packages_shared_examples.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) | |
download | gitlab-ce-0c872e02b2c822e3397515ec324051ff540f0cd5.tar.gz |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/api/packages_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/packages_shared_examples.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/support/shared_examples/requests/api/packages_shared_examples.rb b/spec/support/shared_examples/requests/api/packages_shared_examples.rb index 860cb1b1d86..98264baa61d 100644 --- a/spec/support/shared_examples/requests/api/packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/packages_shared_examples.rb @@ -142,15 +142,26 @@ RSpec.shared_examples 'job token for package uploads' do |authorize_endpoint: fa end end -RSpec.shared_examples 'a package tracking event' do |category, action| +RSpec.shared_examples 'a package tracking event' do |category, action, service_ping_context = true| before do stub_feature_flags(collect_package_events: true) end + let(:context) do + [Gitlab::Tracking::ServicePingContext.new(data_source: :redis_hll, + event: snowplow_gitlab_standard_context[:property]).to_h] + end + it "creates a gitlab tracking event #{action}", :snowplow, :aggregate_failures do expect { subject }.to change { Packages::Event.count }.by(1) - expect_snowplow_event(category: category, action: action, **snowplow_gitlab_standard_context) + if service_ping_context + expect_snowplow_event(category: category, action: action, + label: "redis_hll_counters.user_packages.user_packages_total_unique_counts_monthly", + context: context, **snowplow_gitlab_standard_context) + else + expect_snowplow_event(category: category, action: action, **snowplow_gitlab_standard_context) + end end end |