Commit d16f720d authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'disable_cross_database_join_checking' into 'master'

Disable cross-database query check due to frequent segfaults

See merge request gitlab-org/gitlab!69184
parents 72bdd37f 4f257bc6
......@@ -72,13 +72,10 @@ ALLOW_LIST = Set.new(YAML.load_file(Rails.root.join('.cross-join-allowlist.yml')
RSpec.configure do |config|
config.include(::Database::PreventCrossJoins::SpecHelpers)
config.around do |example|
# TODO: remove `:prevent_cross_joins` to enable the check by default
config.around(:each, :prevent_cross_joins) do |example|
Thread.current[:has_cross_join_exception] = false
if ALLOW_LIST.include?(example.file_path)
example.run
else
with_cross_joins_prevented { example.run }
end
end
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Database::PreventCrossJoins do
context 'when running in a default scope' do
context 'when running in :prevent_cross_joins scope', :prevent_cross_joins do
context 'when only non-CI tables are used' do
it 'does not raise exception' do
expect { main_only_query }.not_to raise_error
......@@ -32,6 +32,14 @@ RSpec.describe Database::PreventCrossJoins do
end
end
context 'when running in a default scope' do
context 'when CI and non-CI tables are used' do
it 'does not raise exception' do
expect { main_and_ci_query }.not_to raise_error
end
end
end
private
def main_only_query
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment