Skip to content

Commit

Permalink
fixing test error
Browse files Browse the repository at this point in the history
  • Loading branch information
gizas committed Mar 7, 2024
1 parent f22d479 commit 3c1e817
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions utils/hints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ func TestGenerateHints(t *testing.T) {
annotations map[string]string
result mapstr.M
}{
// Empty annotations should return empty hints
// {
// name: "test0",
// annotations: map[string]string{},
// result: mapstr.M{},
// },
Empty annotations should return empty hints

Check failure on line 73 in utils/hints_test.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' in composite literal (typecheck)
{
name: "test0",
annotations: map[string]string{},
result: mapstr.M{},
},

// // Scenarios being tested:
// // logs/multiline.pattern must be a nested mapstr.M under hints.logs
// // logs/processors.add_fields must be nested mapstr.M under hints.logs
// // logs/json.keys_under_root must be a nested mapstr.M under hints.logs
// // metrics/module must be found in hints.metrics
// // not.to.include must not be part of hints
// // period is annotated at both container and pod level. Container level value must be in hints
// Scenarios being tested:
// logs/multiline.pattern must be a nested mapstr.M under hints.logs
// logs/processors.add_fields must be nested mapstr.M under hints.logs
// logs/json.keys_under_root must be a nested mapstr.M under hints.logs
// metrics/module must be found in hints.metrics
// not.to.include must not be part of hints
// period is annotated at both container and pod level. Container level value must be in hints
{
name: "test1",
annotations: map[string]string{
Expand Down Expand Up @@ -244,10 +244,8 @@ func TestGenerateHints(t *testing.T) {
}
}
generateHints, incorrecthints := GenerateHints(annMap, "foobar", "co.elastic", allSupportedHints)
//Only in test1 we have added co.elastic.hints.steam annotation with a typo error
//Only in test2 we have added co.elastic.hints.steam annotation with a typo error
if test.name == "test2" {

Check failure on line 248 in utils/hints_test.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' in composite literal (typecheck)
t.Log(annMap)
t.Log(incorrecthints)
assert.Equal(t, 1, len(incorrecthints)) // We validate how many incorrect hints are provided in test1.

Check failure on line 249 in utils/hints_test.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' before newline in composite literal (typecheck)
} else {

Check failure on line 250 in utils/hints_test.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' in composite literal (typecheck)
assert.Equal(t, 0, len(incorrecthints)) // We validate how many incorrect hints are provided in rest of tests

Check failure on line 251 in utils/hints_test.go

View workflow job for this annotation

GitHub Actions / lint

missing ',' before newline in composite literal (typecheck)
Expand Down

0 comments on commit 3c1e817

Please sign in to comment.