rspec_profiling: Discover the correct branch name in GitLab CI
This commit is contained in:
parent
b88e82ff0a
commit
fd38397027
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,12 @@ module RspecProfilingConnection
|
|||
end
|
||||
end
|
||||
|
||||
module RspecProfilingGitBranchCi
|
||||
def branch
|
||||
ENV['CI_BUILD_REF_NAME'] || super
|
||||
end
|
||||
end
|
||||
|
||||
if Rails.env.test?
|
||||
RspecProfiling.configure do |config|
|
||||
if ENV['RSPEC_PROFILING_POSTGRES_URL']
|
||||
|
@ -11,4 +17,6 @@ if Rails.env.test?
|
|||
config.collector = RspecProfiling::Collectors::PSQL
|
||||
end
|
||||
end
|
||||
|
||||
RspecProfiling::VCS::Git.prepend(RspecProfilingGitBranchCi) if ENV.has_key?('CI')
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue