From b354efc2635679f5c98b12c455bb98bb8120ede4 Mon Sep 17 00:00:00 2001 From: William Dumont Date: Tue, 9 Apr 2024 17:16:31 +0200 Subject: [PATCH] fix loki integration test following 3.0 version (#6840) --- .../tests/read-log-file/read_log_file_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/cmd/integration-tests/tests/read-log-file/read_log_file_test.go b/internal/cmd/integration-tests/tests/read-log-file/read_log_file_test.go index 0549fcbb1e72..9799794e7b40 100644 --- a/internal/cmd/integration-tests/tests/read-log-file/read_log_file_test.go +++ b/internal/cmd/integration-tests/tests/read-log-file/read_log_file_test.go @@ -17,10 +17,12 @@ func TestReadLogFile(t *testing.T) { err := common.FetchDataFromURL(query, &logResponse) assert.NoError(c, err) if assert.NotEmpty(c, logResponse.Data.Result) { - assert.Equal(c, logResponse.Data.Result[0].Stream["filename"], "logs.txt") - logs := make([]string, len(logResponse.Data.Result[0].Values)) - for i, valuePair := range logResponse.Data.Result[0].Values { - logs[i] = valuePair[1] + logs := make([]string, 0) + for _, result := range logResponse.Data.Result { + assert.Equal(c, result.Stream["filename"], "logs.txt") + for _, valuePair := range result.Values { + logs = append(logs, valuePair[1]) + } } assert.Contains(c, logs, "[2023-10-02 14:25:43] INFO: Starting the web application...") }