Commit 9d29eb7e authored by Stan Hu's avatar Stan Hu

Merge branch '31933-improve-rspec-profiling-enabling' into 'master'

Enable RSpec profiling only if RSPEC_PROFILING_POSTGRES_URL is not empty

Closes #31933

See merge request !11543
parents 9bf95ddd 29c268ee
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
if Rails.env.test? if Rails.env.test?
RspecProfiling.configure do |config| RspecProfiling.configure do |config|
if ENV['RSPEC_PROFILING_POSTGRES_URL'] if ENV['RSPEC_PROFILING_POSTGRES_URL'].present?
RspecProfiling::Collectors::PSQL.prepend(RspecProfilingExt::PSQL) RspecProfiling::Collectors::PSQL.prepend(RspecProfilingExt::PSQL)
config.collector = RspecProfiling::Collectors::PSQL config.collector = RspecProfiling::Collectors::PSQL
end end
......
...@@ -10,7 +10,7 @@ require 'shoulda/matchers' ...@@ -10,7 +10,7 @@ require 'shoulda/matchers'
require 'rspec/retry' require 'rspec/retry'
rspec_profiling_is_configured = rspec_profiling_is_configured =
ENV['RSPEC_PROFILING_POSTGRES_URL'] || ENV['RSPEC_PROFILING_POSTGRES_URL'].present? ||
ENV['RSPEC_PROFILING'] ENV['RSPEC_PROFILING']
branch_can_be_profiled = branch_can_be_profiled =
ENV['GITLAB_DATABASE'] == 'postgresql' && ENV['GITLAB_DATABASE'] == 'postgresql' &&
......
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