Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
commit84d1bd786125c1c14a3ba5f63e38a4cc736a9027 (patch)
treef550fa965f507077e20dbb6d61a8269a99ef7107 /spec/lib/gitlab/dependency_linker_spec.rb
parent3a105e36e689f7b75482236712f1a47fd5a76814 (diff)
Add latest changes from gitlab-org/gitlab@16-8-stable-eev16.8.0-rc42
Diffstat (limited to 'spec/lib/gitlab/dependency_linker_spec.rb')
-rw-r--r--spec/lib/gitlab/dependency_linker_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/lib/gitlab/dependency_linker_spec.rb b/spec/lib/gitlab/dependency_linker_spec.rb
index 8feab0f8017..4da0b9d8c0d 100644
--- a/spec/lib/gitlab/dependency_linker_spec.rb
+++ b/spec/lib/gitlab/dependency_linker_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
+require 'spec_helper'
RSpec.describe Gitlab::DependencyLinker do
describe '.link' do
@@ -107,5 +107,16 @@ RSpec.describe Gitlab::DependencyLinker do
described_class.link(blob_name, nil, nil)
end
+
+ it 'increments usage counter based on specified used_on', :prometheus do
+ allow(described_class::GemfileLinker).to receive(:link)
+
+ described_class.link('Gemfile', nil, nil, used_on: :diff)
+
+ dependency_linker_usage_counter = Gitlab::Metrics.registry.get(:dependency_linker_usage)
+
+ expect(dependency_linker_usage_counter.get(used_on: :diff)).to eq(1)
+ expect(dependency_linker_usage_counter.get(used_on: :blob)).to eq(0)
+ end
end
end