-
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
[Metricbeat] Add testdata for coredns module #11332
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
The part I don't fully understand yet is why we need multiple If we go down the path of showing more then one event, I would rather do it the same way like we do it for the expected files and write an array into the `data.
Like this all the logic around |
TBH I'm not sure if we actually need multiple
Having all events in a list would be a solution, but no strong opinion on this in general. If you propose we go with it I'm fine, and the same if we decide to go with having only one event in the single |
The conditional events were introduced before we had this new data generation mechanism. Before the data generation was based on a running service and it was not clear which event should be picked and it could have changed on each run. Now the outcome is 100% predicable, so the For now I would stick to just keep the What we should still have for this PR is taking https://github.com/elastic/beats/blob/master/metricbeat/module/coredns/stats/_meta/test/metrics and put it in |
Perfect @ruflin , Thank you for clarifying the conditional events part! I will come back with a single |
@ChrsMark There might a misunderstaing. I would not do the |
One more question :). Do you think we should remove system test since the check about field documentation is happening in |
Not yet. The system test executes the binary and checks if the config options actually work which we don't check here. But long term, perhaps we get there ;-) |
0975057
to
074a441
Compare
Signed-off-by: Chris <chrismarkou92@gmail.com> Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
This should be ok to review. |
As discussed on #10585, we need testdata support for CoreDNS (#10432) module.
This PR adds
testdata
support along with an extension on https://github.com/elastic/beats/blob/master/metricbeat/mb/testing/data/data_test.go so as to handle properly multipledocs.plain
files and multipledata.json
files in case there is conditional event generation like in this of CoreDNS.The rationale here is "have many docs.plain and produce accordingly their
data.json
peers. To illustrate the point:docs.plain
will producedata.json
event1_docs.plain
will producedata_event1.json
event2_docs.plain
will producedata_event2.json
With this I think we are identical to the previous state where again we had multiple
data_*.json
files.Let me know what you think @ruflin.