-
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
Combine Elasticsearch module integration tests #7049
Conversation
39d463a
to
d1790db
Compare
This combines all Elasticsearch module integration tests on the module level. This has the advantage that it removes duplicated code and makes adding a metricset to the test very simple. Also data generators was move to the module level to have it one place. It also should speed up tests as Elasticsearch has to be started only once. As package name `elasticsearch_test` is used to make sure tests happen inside it's own package. For the data generation a path was introduced to still write the data files into the correct directory.
return nil | ||
} | ||
|
||
// WriteEventsReporterV2 fetches events and writes the first event to a ./_meta/data.json | ||
// file. | ||
func WriteEventsReporterV2(f mb.ReportingMetricSetV2, t testing.TB) error { | ||
func WriteEventsReporterV2(f mb.ReportingMetricSetV2, t testing.TB, path string) error { |
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.
I wonder if the path is going to be most of the times based on the metricset name, because then maybe we could guess it from f.Name()
or similar. This would require less knowlegde when writting tests. WDYT?
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.
It is for all tests which are written on the module level. Not sure yet where we end up here TBH. Ok to simplify this later?
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.
Ok
This combines all Elasticsearch module integration tests on the module level. This has the advantage that it removes duplicated code and makes adding a metricset to the test very simple. Also data generators was move to the module level to have it one place. It also should speed up tests as Elasticsearch has to be started only once. As package name `elasticsearch_test` is used to make sure tests happen inside it's own package. For the data generation a path was introduced to still write the data files into the correct directory.
This combines all Elasticsearch module integration tests on the module level. This has the advantage that it removes duplicated code and makes adding a metricset to the test very simple. Also data generators was move to the module level to have it one place. It also should speed up tests as Elasticsearch has to be started only once. As package name `elasticsearch_test` is used to make sure tests happen inside it's own package. For the data generation a path was introduced to still write the data files into the correct directory.
This combines all Elasticsearch module integration tests on the module level. This has the advantage that it removes duplicated code and makes adding a metricset to the test very simple. Also data generators was move to the module level to have it one place. It also should speed up tests as Elasticsearch has to be started only once.
As package name
elasticsearch_test
is used to make sure tests happen inside it's own package.For the data generation a path was introduced to still write the data files into the correct directory.