diff options
author | Nick Thomas <nick@gitlab.com> | 2017-02-10 16:31:06 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-02-10 18:34:23 +0300 |
commit | fd38397027ff7a22915e245fad47959bb2b73f4d (patch) | |
tree | 97f8bb9157a1b24f8ce96bc290ab832980293e7f /config/initializers/rspec_profiling.rb | |
parent | b88e82ff0a1bca9687b5579208ba05a99e41a464 (diff) |
rspec_profiling: Discover the correct branch name in GitLab CI
Diffstat (limited to 'config/initializers/rspec_profiling.rb')
-rw-r--r-- | config/initializers/rspec_profiling.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index f462e654b2c..0ef9f51e5cf 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -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 |