diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 15:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 15:10:12 +0300 |
commit | 419966e5d34a98d89354ed658c33478ce02d8017 (patch) | |
tree | 6a83543e53f483b59953febc8d61a23b19dd5ccb /spec/support/database | |
parent | bfbd788e0910597b93b31020300b15952828c386 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/database')
-rw-r--r-- | spec/support/database/query_analyzer.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/database/query_analyzer.rb b/spec/support/database/query_analyzer.rb new file mode 100644 index 00000000000..85fa55f81ef --- /dev/null +++ b/spec/support/database/query_analyzer.rb @@ -0,0 +1,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 |