From da1e89e1905091d706000d8d3993f612aedf9f2b Mon Sep 17 00:00:00 2001 From: hagen1778 Date: Thu, 7 Nov 2024 13:27:20 +0100 Subject: [PATCH] tests: fix minor typos * rename vmsingle test to actually match the mask * swap got/want arguments, as they were misplaced Signed-off-by: hagen1778 (cherry picked from commit f553628f462a5e8d763e8e2a6ea64821d704e00a) --- apptest/tests/key_concepts_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apptest/tests/key_concepts_test.go b/apptest/tests/key_concepts_test.go index bc07a0e07..40d4a89a5 100644 --- a/apptest/tests/key_concepts_test.go +++ b/apptest/tests/key_concepts_test.go @@ -27,8 +27,8 @@ var docData = []string{ "foo_bar 4.00 1652170560000", // 2022-05-10T08:16:00Z } -// TestVmsingleKeyConceptsQuery verifies cases from https://docs.victoriametrics.com/keyconcepts/#query-data -func TestVmsingleKeyConceptsQuery(t *testing.T) { +// TestSingleKeyConceptsQuery verifies cases from https://docs.victoriametrics.com/keyconcepts/#query-data +func TestSingleKeyConceptsQuery(t *testing.T) { tc := apptest.NewTestCase(t) defer tc.Close() @@ -109,7 +109,7 @@ func testInstantQuery(t *testing.T, q apptest.PrometheusQuerier, opts apptest.Qu got := q.PrometheusAPIV1Query(t, "foo_bar", "2022-05-10T08:03:00.000Z", "5m", opts) want := apptest.NewPrometheusAPIV1QueryResponse(t, `{"data":{"result":[{"metric":{"__name__":"foo_bar"},"value":[1652169780,"3"]}]}}`) opt := cmpopts.IgnoreFields(apptest.PrometheusAPIV1QueryResponse{}, "Status", "Data.ResultType") - if diff := cmp.Diff(got, want, opt); diff != "" { + if diff := cmp.Diff(want, got, opt); diff != "" { t.Errorf("unexpected response (-want, +got):\n%s", diff) } @@ -157,7 +157,7 @@ func testRangeQuery(t *testing.T, q apptest.PrometheusQuerier, opts apptest.Quer s[16] = apptest.NewSample(t, "2022-05-10T08:17:00Z", 4) want.Data.Result[0].Samples = s opt := cmpopts.IgnoreFields(apptest.PrometheusAPIV1QueryResponse{}, "Status", "Data.ResultType") - if diff := cmp.Diff(got, want, opt); diff != "" { + if diff := cmp.Diff(want, got, opt); diff != "" { t.Errorf("unexpected response (-want, +got):\n%s", diff) } }