Commit 7c56c6b5 authored by Alper Akgun's avatar Alper Akgun

Merge branch 'histogram-spec' into 'master'

Fix spec for pg12 in usage_data_queries_spec.rb

See merge request gitlab-org/gitlab!59954
parents 7657abab b06ddc9f
...@@ -63,7 +63,7 @@ RSpec.describe Gitlab::UsageDataQueries do ...@@ -63,7 +63,7 @@ RSpec.describe Gitlab::UsageDataQueries do
it 'returns the histogram sql' do it 'returns the histogram sql' do
expect(described_class.histogram(AlertManagement::HttpIntegration.active, expect(described_class.histogram(AlertManagement::HttpIntegration.active,
:project_id, buckets: 1..2, bucket_size: 101)) :project_id, buckets: 1..2, bucket_size: 101))
.to eq('WITH "count_cte" AS (SELECT COUNT(*) AS count_grouped FROM "alert_management_http_integrations" WHERE "alert_management_http_integrations"."active" = TRUE GROUP BY "alert_management_http_integrations"."project_id") SELECT WIDTH_BUCKET("count_cte"."count_grouped", 1, 2, 100) AS buckets, "count_cte"."count" FROM "count_cte" GROUP BY buckets ORDER BY buckets') .to match(/^WITH "count_cte" AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported}/)
end 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