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

This commit is contained in:
Gábor Farkas 2024-03-14 12:37:04 +01:00 committed by GitHub
parent 0c4e0d0f70
commit 97521ef988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 48 additions and 1 deletions

View File

@ -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"},

View File

@ -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": []
}
}
]
}

View File

@ -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);