Commit a9533de9 authored by Stan Hu's avatar Stan Hu

Fix rspec_profiling not working

rspec_profiling was failing with "rspec_profiling couldn't collect an
example" for specs that had a slash in them because this indicated a
directory that did not exist. To fix this, we substitute slashes for
dashes.
parent 7477d032
......@@ -61,7 +61,7 @@ RspecProfiling.configure do |config|
RspecProfiling::Run.prepend(RspecProfilingExt::Run)
config.collector = RspecProfilingExt::Collectors::CSVWithTimestamps
config.csv_path = -> do
prefix = "#{ENV['CI_JOB_NAME']}-".tr(' ', '-') if ENV['CI_JOB_NAME']
prefix = "#{ENV['CI_JOB_NAME']}-".gsub(/[ \/]/, '-') if ENV['CI_JOB_NAME']
"rspec_profiling/#{prefix}#{Time.now.to_i}-#{SecureRandom.hex(8)}-rspec-data.csv"
end
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