gitlab-org--gitlab-foss/spec/support/database/query_analyzer.rb

18 lines
459 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!
end
end
config.after do |example|
if example.metadata.fetch(:query_analyzers, true)
::Gitlab::Database::QueryAnalyzer.instance.end!
end
end
end