elastic / elastic-package

elastic-package - Command line tool for developing Elastic Integrations
Other
49 stars 112 forks source link

[epic] Integrations can be tested on windows both locally and on CI #1527

Open marc-gr opened 10 months ago

marc-gr commented 10 months ago

This issue is to discuss and track the work required to implement the ability to define and run system tests on windows hosts for integrations.

Prior context:

Problem

Some integrations can run, or run exclusively on windows systems. Currently we lack the ability to run automated tests on windows platforms, neither locally or in CI. This leaves us blind under any possible problems that we may introduce, and we would only find out either performing tedious manual testing or once they are released.

Some of the integrations affected by this are (but maybe not limited to):

Even if the number of affected integrations seems low compared to our total, this effort is still needed for both completeness and the fact that some of these are very widely used integrations.

Requirements

This is a general overview and might be incomplete, would be interesting to gather feedback and ideas to be able to define a specific course of actions towards this.

marc-gr commented 10 months ago

Some additional observations after some testing:

I can think of several paths that can be taken to achieve what we want here, in no particular order:

Is there any preferred path towards this from ecosystem standpoint? Do you have additional ideas about how this could be faced?

cc @jsoriano @mrodm

jsoriano commented 10 months ago

Hey @marc-gr,

If we only want to run the agent in Windows, some way to run custom agents would be a good option, yes. These custom agents could be run natively. We would need to check if we can run multiple agents in the same host, with custom data dirs and so on.

If we want to run the whole stack in Windows, we could implement a new "native" stack provider, that would use the native tar.gz/zip artifacts instead of docker. This would allow to use native artifacts on each platform. We would also need some way to run multiple agents in the same host.

If we want to be able to test windows on linux or the other way around we would need some kind of virtualization, yes. Maybe we can do it based on terraform as you mention. This may be also useful in other use cases, as when testing the system package. I think we had some issues about this.

In general for these cases it would also help to move agent management from the stack providers to the test runners, this way each test could manage its own agent, and we could offer different mechanisms to do that. The kubernetes service deployer already does something like this. Apart of helping on providing agents with different configurations, runnings on different platforms and so on, this would also help on running tests on isolation, avoiding issues like https://github.com/elastic/elastic-package/issues/405.