Enable RSpec profiling only if RSPEC_PROFILING_POSTGRES_URL is not empty

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-05-19 12:15:49 +02:00
parent 0bce9872b4
commit 29c268ee4e
No known key found for this signature in database
GPG Key ID: 46DF07E5CD9E96AB
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ end
if Rails.env.test?
RspecProfiling.configure do |config|
if ENV['RSPEC_PROFILING_POSTGRES_URL']
if ENV['RSPEC_PROFILING_POSTGRES_URL'].present?
RspecProfiling::Collectors::PSQL.prepend(RspecProfilingExt::PSQL)
config.collector = RspecProfiling::Collectors::PSQL
end

View File

@ -10,7 +10,7 @@ require 'shoulda/matchers'
require 'rspec/retry'
rspec_profiling_is_configured =
ENV['RSPEC_PROFILING_POSTGRES_URL'] ||
ENV['RSPEC_PROFILING_POSTGRES_URL'].present? ||
ENV['RSPEC_PROFILING']
branch_can_be_profiled =
ENV['GITLAB_DATABASE'] == 'postgresql' &&