Skip to content

Commit

Permalink
fix loki integration test following 3.0 version (#6840)
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum authored Apr 9, 2024
1 parent 4662360 commit b354efc
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
}
Expand Down

0 comments on commit b354efc

Please sign in to comment.