Skip to content
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] Improve go test flags #13531

Closed
kaiyan-sheng opened this issue Sep 6, 2019 · 2 comments
Closed

[Metricbeat] Improve go test flags #13531

kaiyan-sheng opened this issue Sep 6, 2019 · 2 comments
Assignees
Labels
bug candidate Candidate to be added to the current iteration enhancement Metricbeat Metricbeat Team:Integrations Label for the Integrations team

Comments

@kaiyan-sheng
Copy link
Contributor

When testing kubernetes metricbeat module, I realize we have three different flags for generating/updating files:

go test -generate
go test -data
go test -update_expected

For -generate, it regenerates the .json files under _meta/testdata. For -update_expected, it regenerates the .expected files under _meta/test. For this enhancement, the goal is to use one flag -generate to generate/update all files. So -data and -update_expected can be deprecated later.

It would be nice to have a common package for all kinds of test helpers so they reuse the logic to decide if files should be regenerated.

@kaiyan-sheng kaiyan-sheng added Team:Integrations Label for the Integrations team enhancement Metricbeat Metricbeat labels Sep 6, 2019
@andresrc andresrc added [zube]: Inbox discuss Issue needs further discussion. labels Sep 9, 2019
@andresrc andresrc changed the title [Metricbeat] Improve go test flags [Metricbeat] Improve go test flags Oct 29, 2019
@andresrc andresrc added bug candidate Candidate to be added to the current iteration [zube]: Ready and removed discuss Issue needs further discussion. [zube]: Inbox labels Oct 29, 2019
@jsoriano
Copy link
Member

-data is documented in the devguide and in the checklist of the issue template for new modules, so I would go for it, and deprecate the others.

@mtojek
Copy link
Contributor

mtojek commented Jan 9, 2020

PRs merged, resolving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug candidate Candidate to be added to the current iteration enhancement Metricbeat Metricbeat Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

4 participants