Make dry run configurable for tests

pull/15414/head
Javier Goizueta 5 years ago
parent cb6e10997d
commit 8fd0837a9f

@ -223,15 +223,17 @@ module Carto
end
end
# Perform a dry-run of the query to catch errors (API permissions, SQL syntax, etc.)
# Note that the import may stil fail if using Storage API and needed permission is missing.
sql = @params[:sql_query] || table_query
result = dry_run(@params[:billing_project], sql)
if result[:error]
# TODO: avoid rescuing errors in dry_run? return our own exception here?
raise result[:client_error]
unless @oauth_config['no_dry_run']
# Perform a dry-run of the query to catch errors (API permissions, SQL syntax, etc.)
# Note that the import may stil fail if using Storage API and needed permission is missing.
sql = @params[:sql_query] || table_query
result = dry_run(@params[:billing_project], sql)
if result[:error]
# TODO: avoid rescuing errors in dry_run? return our own exception here?
raise result[:client_error]
end
# TODO: could we make result[:total_bytes_processed] available?
end
# TODO: could we make result[:total_bytes_processed] available?
if !proxy_conf.nil?
@server_conf = @server_conf.merge(proxy_conf)

@ -1770,7 +1770,8 @@ describe Carto::Connector do
'callback_url' => 'https://example.com',
'authorization_uri' => 'https://example.com',
'token_credential_uri' => 'https://example.com',
'revoke_auth_uri' => 'https://example.com'
'revoke_auth_uri' => 'https://example.com',
'no_dry_run' => true
}
}
Cartodb.with_config oauth: oauth_config do

Loading…
Cancel
Save