postgres: improve snapshot-tests for long/wide situations (#84387)

pull/84275/head
Gábor Farkas 2 years ago committed by GitHub
parent 0c4e0d0f70
commit 97521ef988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/tsdb/grafana-postgresql-datasource/postgres_snapshot_test.go
  2. 0
      pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.golden.jsonc
  3. 0
      pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.sql
  4. 36
      pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.golden.jsonc
  5. 10
      pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.sql

@ -98,7 +98,8 @@ func TestIntegrationPostgresSnapshots(t *testing.T) {
format string
}{
{format: "time_series", name: "simple"},
{format: "time_series", name: "no_rows"},
{format: "time_series", name: "no_rows_long"},
{format: "time_series", name: "no_rows_wide"},
{format: "time_series", name: "7x_compat_metric_label"},
{format: "time_series", name: "convert_to_float64"},
{format: "time_series", name: "convert_to_float64_not"},

@ -0,0 +1,36 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl WHERE false"
// }
// Name:
// Dimensions: 0 Fields by 0 Rows
// +
// +
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl WHERE false"
},
"fields": []
},
"data": {
"values": []
}
}
]
}

@ -0,0 +1,10 @@
-- SELECT * FROM tbl WHERE false
CREATE TEMPORARY TABLE tbl (
"time" timestamp with time zone,
v1 double precision,
v2 double precision
);
INSERT INTO tbl ("time", v1, v2) VALUES
('2023-12-24 14:30:03 UTC', 10, 110),
('2023-12-24 14:31:03 UTC', 20, 120);
Loading…
Cancel
Save