Adding integration test for elasticsearch Metricbeat module, xpack code path#15975
Merged
ycombinator merged 8 commits intoelastic:masterfrom Feb 1, 2020
ycombinator:mb-es-xp-int-test
Merged
Adding integration test for elasticsearch Metricbeat module, xpack code path#15975ycombinator merged 8 commits intoelastic:masterfrom ycombinator:mb-es-xp-int-test
ycombinator merged 8 commits intoelastic:masterfrom
ycombinator:mb-es-xp-int-test
Conversation
mtojek
reviewed
Jan 31, 2020
| // as there are distinct shards in Elasticsearch | ||
| if metricSet.Name() == "shard" { | ||
| numShards, err := countShards(host) | ||
| if !assert.NoError(t, err) { |
Contributor
There was a problem hiding this comment.
require.NoError()
I believe you can use require. in multiple places in the test. require fails and stops the test if only the condition is not satisfied.
Contributor
Author
There was a problem hiding this comment.
That's awesome, TIL!
I'll update the usages of assert.* to require.* in this PR here and make a follow up PR to fix them in other tests.
Thanks!
mtojek
approved these changes
Jan 31, 2020
mtojek
reviewed
Jan 31, 2020
| host := service.Host() | ||
|
|
||
| version, err := getElasticsearchVersion(host) | ||
| if err != nil { |
Contributor
There was a problem hiding this comment.
I think you can also apply require here.
Contributor
Author
|
jenkins, test this |
Contributor
|
Pinging @elastic/stack-monitoring (Stack monitoring) |
ycombinator
added a commit
that referenced
this pull request
Feb 11, 2020
…de path (#15975) (#16008) * Define x-pack metricsets for testing purposes * Extract test setup into function * Move test skipping to correct level * Add integration test for xpack.enabled:true data path * Remove debugging statement * Replace usages of assert.* with require.* * One more use of require.* * Fixing method call args
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR:
elasticsearchmodule whenxpack.enabled: trueis set in the module configuration, andelasticsearchintegration test code.Why is it important?
The code path in the
elasticsearchmodule whenxpack.enabledwas set totruewas previously not being exercised by integration tests. Moreover, it's a critical code path as it powers the Stack Monitoring feature.Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration filesRelated issues