Commit 0e15e432 authored by Robert Speicher's avatar Robert Speicher

Merge branch '30907-allow-to-enable-rspec-profile-for-a-given-branch' into 'master'

Allow to enable `rspec_profiling` for a branch on the CI

Closes #30907

See merge request !10680
parents 366f35ca d6550d25
......@@ -9,8 +9,14 @@ require 'rspec/rails'
require 'shoulda/matchers'
require 'rspec/retry'
if (ENV['RSPEC_PROFILING_POSTGRES_URL'] || ENV['RSPEC_PROFILING']) &&
(!ENV.has_key?('CI') || ENV['CI_COMMIT_REF_NAME'] == 'master')
rspec_profiling_is_configured =
ENV['RSPEC_PROFILING_POSTGRES_URL'] ||
ENV['RSPEC_PROFILING']
branch_can_be_profiled =
ENV['CI_COMMIT_REF_NAME'] == 'master' ||
ENV['CI_COMMIT_REF_NAME'] =~ /rspec-profile/
if rspec_profiling_is_configured && (!ENV.key?('CI') || branch_can_be_profiled)
require 'rspec_profiling/rspec'
end
......
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