elasticsearch: more tests (#64971)

* elasticsearch: more tests

* fix issue with uppercase refID on linux

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
This commit is contained in:
Gábor Farkas
2023-03-20 14:50:26 +01:00
committed by GitHub
parent ee2dd62a1f
commit e1321f8721
13 changed files with 851 additions and 1 deletions

View File

@@ -131,6 +131,10 @@ func TestResponseSnapshots(t *testing.T) {
{name: "simple metric test", path: "metric_simple"},
{name: "complex metric test", path: "metric_complex"},
{name: "multi metric test", path: "metric_multi"},
{name: "metric avg test", path: "metric_avg"},
{name: "metric percentiles test", path: "metric_percentiles"},
{name: "metric top_metrics test", path: "metric_top_metrics"},
{name: "metric extended_stats test", path: "metric_extended_stats"},
{name: "raw data test", path: "raw_data"},
{name: "logs test", path: "logs"},
}
@@ -161,7 +165,7 @@ func TestResponseSnapshots(t *testing.T) {
require.Len(t, result.response.Responses, expectedResponseCount)
for refId, dataRes := range result.response.Responses {
goldenFileName := fmt.Sprintf("%v.%v.golden", test.path, refId)
goldenFileName := fmt.Sprintf("%v.%v.golden", test.path, strings.ToLower(refId))
// we make a copy of the variable to avoid this linter-warning:
// "G601: Implicit memory aliasing in for loop."
dataResCopy := dataRes