From 1103945ed4f3e430b8029b4a7893e214dfe289fb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 14 Dec 2022 03:07:29 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/support/database/query_recorder.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/support/database') diff --git a/spec/support/database/query_recorder.rb b/spec/support/database/query_recorder.rb index 3480430a0da..c0736221af3 100644 --- a/spec/support/database/query_recorder.rb +++ b/spec/support/database/query_recorder.rb @@ -5,5 +5,13 @@ RSpec.configure do |config| config.before(:suite) do log_file = Rails.root.join(Gitlab::Database::QueryAnalyzers::QueryRecorder.log_file) File.write(log_file, '') if File.exist?(log_file) + File.delete("#{log_file}.gz") if File.exist?("#{log_file}.gz") + end + + config.after(:suite) do + if ENV['CI'] + log_file = Rails.root.join(Gitlab::Database::QueryAnalyzers::QueryRecorder.log_file) + system("gzip #{log_file}") if File.exist?(log_file) + end end end -- cgit v1.2.3