readQueryLog unmarshal a json-formatted query log into query log lines.
(t *testing.T, path string)
| 436 | |
| 437 | // readQueryLog unmarshal a json-formatted query log into query log lines. |
| 438 | func readQueryLog(t *testing.T, path string) []queryLogLine { |
| 439 | ql := []queryLogLine{} |
| 440 | file, err := os.Open(path) |
| 441 | require.NoError(t, err) |
| 442 | defer file.Close() |
| 443 | |
| 444 | scanner := bufio.NewScanner(file) |
| 445 | for scanner.Scan() { |
| 446 | var q queryLogLine |
| 447 | require.NoError(t, json.Unmarshal(scanner.Bytes(), &q)) |
| 448 | ql = append(ql, q) |
| 449 | } |
| 450 | return ql |
| 451 | } |
| 452 | |
| 453 | // waitForQueryLog waits for the query log to contain at least minEntries entries, |
| 454 | // polling at regular intervals until the timeout is reached. |
no test coverage detected
searching dependent graphs…