-
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
Enhance RabbitMQ test to use real data and test with 3.6 #10667
Conversation
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.
If we have new dependencies we need to add them with govendor
to the repo as otherwise CI does not find them.
It seems the main objective of this PR is to generate a nicer data.json. For this to happen I wonder if we should better go the approach suggested here? #10648
@@ -61,16 +65,27 @@ func TestFetchEventContents(t *testing.T) { | |||
} | |||
|
|||
func TestData(t *testing.T) { | |||
server := mtest.Server(t, mtest.DefaultServerConfig) | |||
defer server.Close() | |||
t.Skip("Skipping `data.json` generation test") |
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.
There is a check in the WriteEventsReporterV2
for the -data
flag. If we want to skip it already here, we should do it based on the -data
flag instead of always skipping it.
I'll take advantage of the new testing interface now on this PR |
43a8c2e
to
30e39b0
Compare
"name": "host.example.com" | ||
"@timestamp": "2019-03-01T08:05:34.853Z", | ||
"error": { | ||
"message": "HTTP error 404 in : 404 Not Found" |
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.
Error document as example? :-)
[ | ||
{ | ||
"error": { | ||
"message": "HTTP error 404 in : 404 Not Found" |
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.
Not sure if this is expected?
} | ||
} | ||
|
||
func TestFetch(t *testing.T) { |
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.
Should we keep this around even though it's skipped. This is as a reminder that we should fix it.
2c22bae
to
246cf5b
Compare
246cf5b
to
38c94b6
Compare
38c94b6
to
5bc7e22
Compare
jenkins, test this please |
5bc7e22
to
718b00a
Compare
Updated the title to show the current state. |
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.
Thanks for working on this.
Please update the compatibility notes mentioning that it should work with 3.6 too.
It'd be also good if we could test the node metricset with multiple versions, but not sure of the best way of doing it.
I passed this PR to ready again to wait until #12228 is in. Then I'll merge conflict and merge. |
6327d63
to
27a0b1f
Compare
Ok, conflicts solved :) Ready for review / merging EDIT: Ups, I forgot to update the compatibility docs. Doing it now. |
@@ -14,7 +14,7 @@ If `management.path_prefix` is set in RabbitMQ configuration, `management_path_p | |||
[float] | |||
=== Compatibility | |||
|
|||
The rabbitmq module is tested with RabbitMQ 3.7.4, and it should be compatible | |||
The rabbitmq module is fully tested with RabbitMQ 3.7.4 and partially tested with 3.6.0, 3.6.5 and 3.7.14 and it should be compatible |
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.
Do we need to be more specific on "partially tested" 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.
I'm just curious if we should be more specific on "partially tested". Other than that it looks good to me!
+1 on what @kaiyan-sheng says related to partial testing. Either we are confident it works and is supported or we should not mention it. Otherwise it's consuming for the customer on what to expect and also from a support perspective, if we support it or not. |
8e61fb3
to
79bc558
Compare
Text have been changed to reflect what's exactly tested with which version |
jenkins, test this please |
"Fixes" this issue #10014 by:
Currently, RabbitMQ module uses local data stored here to mock responses from the server during tests. This also generates file
data.json
which is not very nice.AFAIK, the "missing data" reported in the issue are some fields that aren't parsed by design.
Current PR uses exchange Metricset to actively send messages and consume them from a RabbitMQ instance, to later produce a real
data.json
file.My main concern about this PR are:
Comments welcome :)
EDIT:
Finally I added some version specific tests using the new framework and updated to_error V2_ interface_. I couldn't update Metricset
node
to use the new testing framework because it needs 2 HTTP calls to fetch metrics (and the testing framework it only with single HTTP calls at the moment)