-
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
Adding integration test for elasticsearch Metricbeat module, xpack code path #15975
Conversation
// as there are distinct shards in Elasticsearch | ||
if metricSet.Name() == "shard" { | ||
numShards, err := countShards(host) | ||
if !assert.NoError(t, err) { |
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.
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.
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.
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!
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.
Follow up PR: #15993.
bab4343
to
3f383cd
Compare
host := service.Host() | ||
|
||
version, err := getElasticsearchVersion(host) | ||
if err != nil { |
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 think you can also apply require
here.
jenkins, test this |
Pinging @elastic/stack-monitoring (Stack monitoring) |
…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
What does this PR do?
This PR:
elasticsearch
module whenxpack.enabled: true
is set in the module configuration, andelasticsearch
integration test code.Why is it important?
The code path in the
elasticsearch
module whenxpack.enabled
was set totrue
was 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