-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for documented fields check for metricsets without a http input #17334
Conversation
Pinging @elastic/integrations (Team:Integrations) |
metricbeat/mb/testing/testdata.go
Outdated
// should cover scenarios as azure.compute_vm_scaleset.*.* | ||
key = strings.Join(splits[0:pos], ".") + ".*.*" | ||
if _, ok := knownKeys[key]; ok { | ||
found = true | ||
break | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be done in all values of pos
, .*.*
should only replace the last 2 splits. I think this code can go outside this loop
continue | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about adding unit tests for this function? I see it has started to grow and I foresee we will keep updating it for a while
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well spotted, added a test in testdata_test.go
…put (elastic#17334) * add test for documented fields * changelog * work on test * add test for testdata * fmt update (cherry picked from commit e545836)
…put (elastic#17334) * add test for documented fields * changelog * work on test * add test for testdata * fmt update (cherry picked from commit e545836)
…k for metricsets without a http input (elastic#17438) * Add test for documented fields check for metricsets without a http input (elastic#17334) * add test for documented fields * changelog * work on test * add test for testdata * fmt update (cherry picked from commit 072f28e) * update changelog
What does this PR do?
Adds a test to check that the metricset fields are documented based on the events generated in the integration tests.
Why is it important?
This is a step in the requirements for moving modules/metricsets to GA.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Add
mbtest.TestMetricsetFieldsDocumented
to the integration testRelated issues