-
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
[Metricbeat] Migrate Kubernetes state_deployment Metricset to use ReporterV2 interface #10961
[Metricbeat] Migrate Kubernetes state_deployment Metricset to use ReporterV2 interface #10961
Conversation
Error in filebeat seems unrelated https://beats-ci.elastic.co/job/elastic+beats+pull-request+multijob-windows/5387/console |
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.
Please check if final events are being correctly namespaced, having an update data.json
will help.
metricbeat/module/kubernetes/state_deployment/state_deployment_test.go
Outdated
Show resolved
Hide resolved
f4834cf
to
5b34853
Compare
jenkins, test this |
Nevermind: I placed test data in the wrong folder 😄 |
Error is related. Checking |
12c0f36
to
485d0a6
Compare
@@ -219,7 +219,7 @@ func checkDocumented(t *testing.T, data []common.MapStr) { | |||
if _, ok := keys[prefix+".*"]; ok { | |||
continue | |||
} | |||
t.Fatalf("key missing: %s", k) | |||
t.Fatalf("check if fields are documented error: key missing '%s'", k) |
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.
@ruflin I added this because the original message did not show very clearly what was failing and it took me a while to figure out (until I checked the error line in fact). I hope this is ok :)
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.
LGTM.
@exekias Could you also have a look if the events still look as expected. Please ping me if you need an update on the new test framework and what we changed.
@@ -132,5 +123,23 @@ func testCases() map[string]map[string]interface{} { | |||
"replicas.unavailable": 0, | |||
"replicas.updated": 1, | |||
}, | |||
"jenkins@wise-lynx-jenkins": { |
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 also had to add this two "expected" events that were missing when running tests. I don't understand how they weren't failing before 🤔
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.
The fields exist in the test file so I assume it's correct 🤞
this may need a changelog entry? |
|
||
assert.Equal(t, 5, len(events), "Wrong number of returned events") | ||
|
||
testCases := testCases() | ||
for _, event := range events { | ||
name, err := event.GetValue("name") | ||
metricsetFields := event.MetricSetFields | ||
name, err := metricsetFields.GetValue("name") | ||
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.
just curious, do we need to deal with when err != nil
here?
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 was originally like this so I prefer to leave it
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.
LGTM
@exekias I don't think we need a changelog as it does not have any affect on the user.
@@ -132,5 +123,23 @@ func testCases() map[string]map[string]interface{} { | |||
"replicas.unavailable": 0, | |||
"replicas.updated": 1, | |||
}, | |||
"jenkins@wise-lynx-jenkins": { |
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.
The fields exist in the test file so I assume it's correct 🤞
Refer to #10774 for more info