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

Add include package to x-pack Metricbeat #9509

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Dec 12, 2018

The include package was not loaded so far which means modules were not included in the binary. Also this adds a main_test.go file which is used to build the test binary for the system tests.

@ruflin
Copy link
Member Author

ruflin commented Dec 12, 2018

@kaiyan-sheng This might explain if you had trouble with testing.

The include package was not loaded so far which means modules were not included in the binary. Also this adds a main_test.go file which is used to build the test binary for the system tests.
@@ -0,0 +1,27 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewkroh To build this binary should we add the logic to the Makefile or try to do it also in mage? Do we have that already somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewkroh I just realised in 6.x filebeat x-pack I can run make filebeat.test but not in 7.0. I wonder if that is a missing PR in master or was removed on purpose?

Copy link
Member

Choose a reason for hiding this comment

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

It was removed on purpose. The Makefiles in x-pack// are really minimal with just enough targets to make the existing CI systems continue to work. When you execute any of the targets that require the binary it will be produced (like mage unitTest, mage integTest, mage pythonUnitTest, or mage pythonIntegTest).

mg.Deps(mage.BuildSystemTestBinary)

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think about having a mage target for just building the test binary? I use this pretty often for manual test runs if I only want to run a subset of system tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I won't add another command to the extensive list of commands we already have / need to use before every push to repo. Instead, I'll integrate this action (say build) within each command which interacts directly with the Go code (almost all commands now I guess) as the first step in a chain of actions, for example before setting up compose or checking fields: you don't compile so I fail in 20s and my CI slot is free again. Go compile time is pretty fast and this way we reduce cognitive load to everybody.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I can follow. I'm not worried about the failing of the building the Beats binary but how I run for example the system tests only for the Elasticsearch module. To do this, I need to test binary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, system tests should be run with mage too, so mage should check compile correctness before running system tests but not as a separate command. I propose that compile correctness is integrated within the system test command (and unit test, integration test, etc.) so it's checked always.

Copy link
Member Author

Choose a reason for hiding this comment

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

I still don't understand how I will run a single test locally if we don't have the target without me manually coming up with the details for building it each time? My goal here is not to figure out if the binary compiles or not as part of CI.

Copy link
Contributor

Choose a reason for hiding this comment

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

So yeah, my goal is that it's done within the CI :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's assume I build module foo localy: How do I test only this module locally? And I do not want to test the binary but if the module works. Pushing always to CI to see if it works is not an option as I want to be able to develop offline and that would be way too slow for quick development feedback.

@ruflin ruflin added the Team:Integrations Label for the Integrations team label Dec 12, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/infrastructure

@ruflin ruflin self-assigned this Dec 12, 2018
@ruflin
Copy link
Member Author

ruflin commented Dec 12, 2018

jenkins, test this

Copy link
Contributor

@sayden sayden left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

Thanks for pointing out to me!

@sayden sayden mentioned this pull request Dec 12, 2018
10 tasks
@sayden
Copy link
Contributor

sayden commented Dec 13, 2018

jenkins, test this

@ruflin ruflin merged commit d8ed74a into elastic:master Dec 13, 2018
@ruflin ruflin deleted the fix-xpack-binary branch December 13, 2018 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants