Skip to content

Commit

Permalink
print names of nodes without expected logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Dec 9, 2024
1 parent 4fa7ba6 commit 726a0b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integration-tests/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,19 @@ func assertCorrectNodeConfiguration(t *testing.T, l zerolog.Logger, totalNodeCou
close(resultsCh)

var correctlyConfiguredNodes []string
var incorrectlyConfiguredNodes []string

// check results
for result := range resultsCh {
for nodeName, patternsFound := range result {
if len(patternsFound) == len(expectedPatterns) {
correctlyConfiguredNodes = append(correctlyConfiguredNodes, nodeName)
} else {
incorrectlyConfiguredNodes = append(incorrectlyConfiguredNodes, nodeName)
}
}
}

require.Equal(t, len(correctlyConfiguredNodes), expectedNodeCount, "%d nodes' logs were missing expected plugin configuration entries. Correctly configured nodes: %s. Expected log patterns: %s", expectedNodeCount-len(correctlyConfiguredNodes), strings.Join(correctlyConfiguredNodes, ","), strings.Join(expectedPatterns, ","))
require.Equal(t, len(correctlyConfiguredNodes), expectedNodeCount, "%d nodes' logs were missing expected plugin configuration entries. Correctly configured nodes: %s. Nodes with missing configuration: %s. Expected log patterns: %s", expectedNodeCount-len(correctlyConfiguredNodes), strings.Join(correctlyConfiguredNodes, ", "), strings.Join(incorrectlyConfiguredNodes, ", "), strings.Join(expectedPatterns, ", "))
l.Info().Msg("All nodes have correct plugin configuration applied")
}

0 comments on commit 726a0b3

Please sign in to comment.