summaryrefslogtreecommitdiff
path: root/spec/support/database/query_analyzer.rb
blob: 85fa55f81efd1ed8d20c7a668e7d41efe863a1b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

# With the usage of `describe '...', query_analyzers: false`
# can be disabled selectively

RSpec.configure do |config|
  config.around do |example|
    if example.metadata.fetch(:query_analyzers, true)
      ::Gitlab::Database::QueryAnalyzer.instance.within { example.run }
    else
      example.run
    end
  end
end