-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Stack Monitoring] Enable testing of latest package versions #146000
Comments
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
There's a way to load packages bundled on the filesystem with the This attempt #146355 to replace package mappings with preinstalled packages is fairly successful in that Stack Monitoring tests are green. However loading the packages on the test server used by every other plugin causes side effects, so we'd have to create a dedicated test server for monitoring api tests like fleet. @kpollich is there any counter indication using |
Sorry I'm not sure I understand the question. Could you rephrase? |
Is the setting safe to use and is it the recommended approach to load packages for automated testing purposes ? |
Thanks for clarifying. This setting will control from where Fleet loads its bundled packages. Note that bundled packages are not automatically installed - just available on disk. Bundled packages exist to support offline environments. If you'd like to install some packages by default, then you can use |
### Summary **Sets up the foundations for #146000 - created a new test server under `x-pack/test/monitoring_api_integration/` that allows loading of packages at kibana startup - a test runner utility which is a simple for loop executing the supplied test twice, one time with `metricbeat` data and a second time with `package` data - a utility that allows transformation of package data into metricbeat data **Adds API tests for the beats package** - created a test case for each API exposed - removed the duplicates from `x-pack/test/api_integration/apis/monitoring` ----- _See the included [README](https://github.com/elastic/kibana/blob/b55de5c1ccf2d654bd03cf5f856765fdc85c82f6/x-pack/test/monitoring_api_integration/README.md) for additional details_ This directory defines a custom test server that provides bundled integrations packages to the spawned test Kibana. This allows us to install those packages at startup, with all their assets (index templates, ingest pipelines..), without having to reach a remote package registry. With the packages and their templates already installed we don't have to provide the static mappings in the tests archives. This has the benefit of reducing our disk footprint and setup time but more importantly it enables an easy upgrade path of the mappings so we can verify no breaking changes were introduced by bundling the new versions of the packages. _Note that while Stack Monitoring currently supports 3 collection modes, the tests in this directory only focus on metricbeat and elastic-agent data. Tests for legacy data are defined under `x-pack/test/api_integration/apis/monitoring`._ Since an elastic-agent integration spawns the corresponding metricbeat module under the hood (ie when an agent policy defines elasticsearch metrics data streams, a metricbeat process with the elasticsearch module will be spawned), the output documents are _almost_ identical. This means that we can easily transform documents from a source (elastic-agent) to another (metricbeat), and have the same tests run against both datasets. Note that we don't have to install anything for the metricbeat data since the mappings are already installed by elasticseach at startup, and available at `.monitoring-<component>-8-mb` patterns. So we are always running the metricbeat tests against the latest version of the mappings. We could have a similar approach for packages, for example by installing the latest packages versions from public EPR before the test suites run, instead of using pinned versions. Besides the questionable reliance on remote services for running tests, this is also dangerous given that packages are released in a continuous model. This means that whenever the test suite would execute against the latest version of packages it would be too late, as in already available to users. Co-authored-by: kibanamachine <[email protected]>
Completed in #147755 |
Summary
We added integration tests for Agent based data in #119658. At this moment the tests work by loading a standard es-archiver bundle containing both static mappings of the
metrics-*
data streams and corresponding documents (example).Ideally each update of the mappings in the packages should be reflected in the static archive in order to validate no regression were introduced as new versions are released.
xpack.fleet.developer.bundledPackageLocation
to load local packages without spawning a local registry. Because loading packages can have side effects on test suites of the other kibana plugins we'll have a create a dedicated suite spawning its own kibana test server (fleet example). See [Stack Monitoring] install bundled package for tests #146355 for the blueprintFor 2. we'll have to:
/api/fleet/epm/packages/${pkg}/
to install the package assets. Consider doing this at the top level of the test suite so we only have to do one setup/teardown cyclemappings.json
files from all the _package archivesAC
The text was updated successfully, but these errors were encountered: