Commit 8c82e749 authored by Stan Hu's avatar Stan Hu

Add CI_JOB_NAME to rspec_profiling output filename

Having the CI_JOB_NAME in the filename would have made it much easier to
track down the failing CSV file in
https://gitlab.com/gitlab-org/gitlab/issues/120012. We would have been
able to go to the job in question and download the artifacts directly
instead of downloading all artifacts from the pipeline.
parent 3c188002
......@@ -60,6 +60,9 @@ RspecProfiling.configure do |config|
RspecProfiling::VCS::Git.prepend(RspecProfilingExt::Git)
RspecProfiling::Run.prepend(RspecProfilingExt::Run)
config.collector = RspecProfilingExt::Collectors::CSVWithTimestamps
config.csv_path = -> { "rspec_profiling/#{Time.now.to_i}-#{SecureRandom.hex(8)}-rspec-data.csv" }
config.csv_path = -> do
prefix = "#{ENV['CI_JOB_NAME']}-".tr(' ', '-') if ENV['CI_JOB_NAME']
"rspec_profiling/#{prefix}#{Time.now.to_i}-#{SecureRandom.hex(8)}-rspec-data.csv"
end
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