Commit 48b75ece authored by Piotr Skorupa's avatar Piotr Skorupa

Refactor rake task

parent a75b5a28
...@@ -53,11 +53,13 @@ namespace :gitlab do ...@@ -53,11 +53,13 @@ namespace :gitlab do
desc 'GitLab | UsageDataMetrics | Generate raw SQL metrics queries fixture for RSpec' desc 'GitLab | UsageDataMetrics | Generate raw SQL metrics queries fixture for RSpec'
task generate_sql_metrics_fixture: :environment do task generate_sql_metrics_fixture: :environment do
path = Rails.root.join('spec/fixtures/lib/gitlab/usage/sql_metrics_queries.json')
queries = Timecop.freeze(2021, 1, 1) do queries = Timecop.freeze(2021, 1, 1) do
Gitlab::Usage::ServicePingReport.for(output: :metrics_queries) Gitlab::Usage::ServicePingReport.for(output: :metrics_queries)
end end
File.write('spec/fixtures/lib/gitlab/usage/sql_metrics_queries.json', Gitlab::Json.pretty_generate(queries)) File.write(path, Gitlab::Json.pretty_generate(queries))
end end
def ci_template_includes_hash(source, template_directory = nil) def ci_template_includes_hash(source, template_directory = nil)
......
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