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

Selective testing in beats and test with latest version of the branch. #9496

Closed
ph opened this issue Dec 11, 2018 · 10 comments
Closed

Selective testing in beats and test with latest version of the branch. #9496

ph opened this issue Dec 11, 2018 · 10 comments
Assignees
Labels
automation discuss Issue needs further discussion. Team:Integrations Label for the Integrations team :Testing

Comments

@ph
Copy link
Contributor

ph commented Dec 11, 2018

Beats is a mono repo of many projects and has a lot of tests to run. When a PR is created, our CI will run the tests for all the beats even if no code was changed in that project. This lead to longer test time and bigger CI queues, it not uncommon to have to wait more than one or two hours when we are close to the feature freeze.

I would like to implement selective testings, what I mean by that is:

  1. A change of code in Filebeat should only run the test in Filebeat.
  2. A change in Auditbeat should only run the tests in Auditbeat
  3. A change in Metricbeat should trigger a tests in Metricbeat and Auditbeat.
  4. A change in libbeat should run the tests in all the beats.
  5. A new vendor should trigger the tests in dependant beats.
  6. A change in a module in Filebeat should only trigger the test_modules for that module.
  7. A change in a module in Metricbeat should only run the test for that module.
  8. When the docs are changed only run the doc tests.

To make the above work we probably need to either use a tool to get the dependency graph and generate what need to be executed or we could probably have a crude implementation purely based on path or maybe something that use both.

The other thing I would like to have is instead of only testing the PR code in the branch is to merge the PR of with the latest version of the target branch and then run the tests. When the PR tests are green and the PR is ready to merge it doesn't mean the branch will be green after the merge.

The above is based on discussion that @urso and myself had.

@ph ph added discuss Issue needs further discussion. :Testing labels Dec 11, 2018
@ph
Copy link
Contributor Author

ph commented Dec 11, 2018

We probably want to investigate baur, this is tool to build and tests monorepo project. It requires to keep states in a postgresql databased. I would prefer to have something stateless and easy to deploy and run locally.

@ruflin
Copy link
Member

ruflin commented Dec 11, 2018

@ph The apm-server team is currently migrating to pipelines and I think we should too: elastic/apm-server#1466 It will remove lots of the dependency from JJB files and I think it will also allow things similar to what you suggest above. @kuisathaverat can perhaps comment on this?

@ph
Copy link
Contributor Author

ph commented Dec 11, 2018

@ruflin I think both are complementarity.

@kuisathaverat
Copy link
Contributor

Indeed they are, as better granularity, you have to run tests isolated, it makes easier to run then in parallel or filter which test you want to run based on files, path, labels, comments, whatever you want to check before to trigger a test, e.g for the APM UI we have a very similar issue, everytime we push something to kibana we have to wait for all the kibana-ci test to know if everything is OK, it is fine to do that, but we need also for us a quick set of checks/tests that should be run on the CI and are faster than run the whole CI tests, so we will run on our apm-ci a job that will identify our PRs based on the changes made on files and trigger a build that makes our tests.

@ph
Copy link
Contributor Author

ph commented Dec 12, 2018

@kuisathaverat thanks for the details I will take a closer look.

@jsoriano
Copy link
Member

+1 I also wanted to try something like this to avoid running all metricbeat modules even if nothing has changed for them.

The other thing I would like to have is instead of only testing the PR code in the branch is to merge the PR of with the latest version of the target branch and then run the tests. When the PR tests are green and the PR is ready to merge it doesn't mean the branch will be green after the merge.

Big +1 for this too, could you create another issue for that? I think they are two separated topics. For this we'd need an integration pipeline that tests and merges PRs one to one.

@ph
Copy link
Contributor Author

ph commented Dec 13, 2018

@jsoriano Created another issue in #9524

@kuisathaverat
Copy link
Contributor

The other thing I would like to have is instead of only testing the PR code in the branch is to merge the PR of with the latest version of the target branch and then run the tests. When the PR tests are green and the PR is ready to merge it doesn't mean the branch will be green after the merge.

Multibranch pipeline project make it, you can choose to build the PR merged with the master (default), only the PR release, or both

screenshot 2018-12-14 at 11 26 08

This is how to looks like when you choose both

screenshot 2018-12-14 at 11 28 32

@ruflin
Copy link
Member

ruflin commented Dec 14, 2018

I started #9543 so we can start to play around with Pipelines for these things in PR's as soon as we have the setup for pipelines in Jenkins.

@kuisathaverat
Copy link
Contributor

This is already implemented in the pipeline, we will continue making incremental improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation discuss Issue needs further discussion. Team:Integrations Label for the Integrations team :Testing
Projects
None yet
Development

No branches or pull requests

7 participants