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

Combine Elasticsearch module integration tests #7049

Merged
merged 1 commit into from
May 9, 2018

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented May 9, 2018

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.

@ruflin ruflin added in progress Pull request is currently in progress. module review Metricbeat Metricbeat labels May 9, 2018
@ruflin ruflin force-pushed the unify-es-tests branch 2 times, most recently from 39d463a to d1790db Compare May 9, 2018 08:31
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.
@ruflin ruflin force-pushed the unify-es-tests branch from d1790db to 399657c Compare May 9, 2018 08:45
@ruflin ruflin removed the in progress Pull request is currently in progress. label May 9, 2018
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 {
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@jsoriano jsoriano merged commit 225d5c3 into elastic:master May 9, 2018
@ruflin ruflin deleted the unify-es-tests branch May 9, 2018 12:37
stevea78 pushed a commit to stevea78/beats that referenced this pull request May 20, 2018
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.
stevea78 pushed a commit to stevea78/beats that referenced this pull request May 20, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants