Welcome to mirror list, hosted at ThFree Co, Russian Federation.

query_recorder.rb « database « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c0736221af362b4676f6d303b63ae48933558505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

RSpec.configure do |config|
  # Truncate the query_recorder log file before starting the suite
  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