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

Support using the Elastic Agent integration testing framework to run tests against Serverless projects #36675

Open
cmacknz opened this issue Sep 25, 2023 · 3 comments
Labels
Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@cmacknz
Copy link
Member

cmacknz commented Sep 25, 2023

elastic/elastic-agent#3258 adds the ability to provision Serverless projects in the Elastic Agent integration testing framework, the ability to install standalone Beats on test VMs, and several tests of standalone Beats interacting with Serverless projects.

The scope of this issue is to move these tests to the Beats repository and allow using the Elastic Agent integration testing framework to run them. The Elastic Agent integration testing framework was designed from the beginning to be used from other repositories. This will also enable integration testing specifically between Beats and Elastic Agent whenever the Beats code changes.

To do this we will need to do at least the following tasks:

  1. Make the integration testing targets defined in the Elastic Agent magefile importable from Beats.
  2. Move the serverless Beats tests to the Beats repository and ensure they can be run manually from the Beats repository.
  3. Create a Buildkite pipeline specifically for running these integration tests in the Beats repository.

The agent integration testing framework is currently Elastic licensed and so all builds targets and code related to it in Beats must exist only in the x-pack directory.

@alexsapran
Copy link
Contributor

We should also rethink how the framework deals with serverless projects. The elastic-agent repo, which has a low volume compared to Beats, is hitting the limits; if we were to set these in the Beats, which is a higher traffic repo, we would cause unintended issues.

@cmacknz
Copy link
Member Author

cmacknz commented May 21, 2024

At the time this was written there was a belief that the only way to test serverless was by creating real serverless projects. It appears is actually possible to use the elasticsearch-serverless Docker image to create a local serverless cluster, just with more work than a simple docker run ....

Kibana has done this, see https://github.com/elastic/kibana/blob/14d459f5816ba1531f284a19858967809d853dd8/packages/kbn-es/src/utils/docker.ts#L718-L725 for the implementation.

This could give us a path to running Beats serverless tests against a Docker cluster, which would align much more closely with the way Beats does integration tests today. The primary caveat is the serverless Beats test would have to be rewritten to use this approach.

The Elastic Agent serverless tests might be a bit trickier as they depend on Fleet running beyond just Elasticsearch and Kibana themselves.

@ycombinator ycombinator added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label May 29, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

4 participants