diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 03:09:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 03:09:58 +0300 |
commit | 3c25c55bf591097e96170c2d2da1b40d295cc981 (patch) | |
tree | 5418c6aa14eb79619079d1aa7918ae27d6600d46 /spec/lib | |
parent | c991a74ffd36af636f3083fed93c0f6e81746f02 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/usage/metrics/instrumentations/count_deployments_metric_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/usage_data_counters/visual_studio_extension_activity_unique_counter_spec.rb | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/spec/lib/gitlab/usage/metrics/instrumentations/count_deployments_metric_spec.rb b/spec/lib/gitlab/usage/metrics/instrumentations/count_deployments_metric_spec.rb index 538be7bbdc4..7fd5b135a4a 100644 --- a/spec/lib/gitlab/usage/metrics/instrumentations/count_deployments_metric_spec.rb +++ b/spec/lib/gitlab/usage/metrics/instrumentations/count_deployments_metric_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe Gitlab::Usage::Metrics::Instrumentations::CountDeploymentsMetric, feature_category: :service_ping do using RSpec::Parameterized::TableSyntax - before(:all) do + before_all do env = create(:environment) [3, 60].each do |n| deployment_options = { created_at: n.days.ago, project: env.project, environment: env } diff --git a/spec/lib/gitlab/usage_data_counters/visual_studio_extension_activity_unique_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/visual_studio_extension_activity_unique_counter_spec.rb new file mode 100644 index 00000000000..57cf173f793 --- /dev/null +++ b/spec/lib/gitlab/usage_data_counters/visual_studio_extension_activity_unique_counter_spec.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::UsageDataCounters::VisualStudioExtensionActivityUniqueCounter, :clean_gitlab_redis_shared_state, feature_category: :editor_extensions do + let(:user1) { build(:user, id: 1) } + let(:user2) { build(:user, id: 2) } + let(:time) { Time.current } + let(:action) { described_class::VISUAL_STUDIO_EXTENSION_API_REQUEST_ACTION } + let(:user_agent_string) do + 'code-completions-language-server-experiment (gl-visual-studio-extension:1.0.0.0; arch:X64;)' + end + + let(:user_agent) { { user_agent: user_agent_string } } + + context 'when tracking a visual studio api request' do + it_behaves_like 'a request from an extension' + end +end |