[v11.0.x] postgres: improved tests (#86181)

postgres: improved tests (#84677)

* postgres: tests: better test aligning time-series results

* postgres: add snapshot test for a backward-compat code

(cherry picked from commit c835022861)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-15 16:27:44 +01:00
committed by GitHub
co-authored by Gábor Farkas
parent 6204c035df
commit bce6d445e9
7 changed files with 267 additions and 2 deletions
@@ -98,8 +98,8 @@ func TestIntegrationPostgresSnapshots(t *testing.T) {
JSON: queryBytes,
RefID: "A",
TimeRange: backend.TimeRange{
From: time.Date(2023, 12, 24, 14, 15, 0, 0, time.UTC),
To: time.Date(2023, 12, 24, 14, 45, 0, 0, time.UTC),
From: time.Date(2023, 12, 24, 14, 15, 22, 123456, time.UTC),
To: time.Date(2023, 12, 24, 14, 45, 13, 876543, time.UTC),
},
},
},
@@ -119,6 +119,7 @@ func TestIntegrationPostgresSnapshots(t *testing.T) {
{format: "time_series", name: "fill_null"},
{format: "time_series", name: "fill_previous"},
{format: "time_series", name: "fill_value"},
{format: "time_series", name: "fill_value_wide"},
{format: "table", name: "simple"},
{format: "table", name: "no_rows"},
{format: "table", name: "types_numeric"},
@@ -129,6 +130,8 @@ func TestIntegrationPostgresSnapshots(t *testing.T) {
{format: "table", name: "timestamp_convert_integer"},
{format: "table", name: "timestamp_convert_real"},
{format: "table", name: "timestamp_convert_double"},
{format: "table", name: "time_group_compat_case1"},
{format: "table", name: "time_group_compat_case2"},
}
for _, test := range tt {