debian-mirror-gitlab/spec/support/database/query_analyzer.rb
2022-07-16 19:58:13 +02:00

22 lines
607 B
Ruby

# frozen_string_literal: true
# With the usage of `describe '...', query_analyzers: false`
# can be disabled selectively
RSpec.configure do |config|
config.before do |example|
if example.metadata.fetch(:query_analyzers, true)
::Gitlab::Database::QueryAnalyzer.instance.begin!(
::Gitlab::Database::QueryAnalyzer.instance.all_analyzers
)
end
end
config.after do |example|
if example.metadata.fetch(:query_analyzers, true)
::Gitlab::Database::QueryAnalyzer.instance.end!(
::Gitlab::Database::QueryAnalyzer.instance.all_analyzers
)
end
end
end