-
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
[kbn/test] add import/export support to KbnClient #92526
[kbn/test] add import/export support to KbnClient #92526
Conversation
Add svc, integrate into one test, add exported saved objects, add empty kibana call, and update ftr schema...add data directory for the new svc.
Make public api take one argument.
Make typescript happier.
Using the esArchiver to load an empty Kibana index requires that we recreate the index from scratch, including running migrations, which is time intensive and requires that the Kibana server works at some level with the Kibana index disappearing randomly. If we can get away from this I think it would be ideal. In most cases I expect that we can use |
I guess that .clean would work. In most cases it's just index-patterns, searches, visualizations, and dashboards. If we clean those before loading the test set, and clean again in the after method we'll probably be good. I'm OK with trying to move away from using esArchiver for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on include docs similar to esArchiver in https://www.elastic.co/guide/en/kibana/master/development-tests.html?
I'd be interested in guidance on when to use esArchiver vs kbnArchiver and the new workflow expected for running functional tests
👍 I think that's a great idea, will make sure this PR includes the docs before merge.
The general plan is to migrate all Kibana Saved Objects interactions to the |
…er/kibana into implement/kbn-client-import-export
b24dbcb
to
21fe068
Compare
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security Solution changes LGTM! 👍
Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: spalger <[email protected]>
Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: spalger <[email protected]>
Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: spalger <[email protected]> Co-authored-by: Spencer <[email protected]> Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: spalger <[email protected]>
Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: spalger <[email protected]> Co-authored-by: Spencer <[email protected]> Co-authored-by: Tre' Seymour <[email protected]> Co-authored-by: spalger <[email protected]>
…bana into task-manager/docs-monitoring * 'task-manager/docs-monitoring' of github.com:gmmorris/kibana: (40 commits) [Security Solution][Case][Bug] Improve case logging (elastic#91924) [Alerts][Doc] Added README documentation for alerts plugin status and framework health checks configuration options. (elastic#92761) Add warning for EQL and Threshold rules if exception list contains value list items (elastic#92914) [Security Solution][Case] Fix subcases bugs on detections and case view (elastic#91836) [APM] Always allow access to Profiling via URL (elastic#92889) [Vega] Allow image loading without CORS policy by changing the default to crossOrigin=null (elastic#91991) skip flaky suite (elastic#92114) [APM] Fix for default fields in correlations view (elastic#91868) (elastic#92090) chore(NA): bump bazelisk to v1.7.5 (elastic#92905) [Maps] fix selecting EMS basemap does not populate input (elastic#92711) API docs (elastic#92827) [kbn/test] add import/export support to KbnClient (elastic#92526) Test fix management scripted field filter functional test and unskip it (elastic#92756) [App Search] Create Curation view/functionality (elastic#92560) [Reporting/Discover] include the document's entire set of fields (elastic#92730) [Fleet] Add new index to fleet for artifacts being served out of fleet-server (elastic#92860) [Alerts][Doc] Added README documentation for API key invalidation configuration options. (elastic#92757) [Discover][docs] Add search for relevance (elastic#90611) [Alerts][Docs] Extended README.md and the user docs with the licensing information. (elastic#92564) [7.12][Telemetry] Security telemetry allowlist fix. (elastic#92850) ...
Closes #89368 |
This PR implements a client for using the Saved Objects
import
andexport
APIs by writing exports to disk and loading imports from disk into Kibana. This client lives within theKbnClient
, and is exposed to the FTR test via thekibanaServer
service.kibanaServer.importExport.save(name, { types, space })
- Save an export of saved objects of listed types (optionally specifying a space) to disk using the given name.kibanaServer.importExport.load(name, { space })
- Load an export from disk by name into Kibana, optionally into a specific space.kibanaServer.importExport.unload(name, { space })
- Delete the saved objects from Kibana which share atype
andid
with objects in the named export on disk.kibanaServer.savedObjects.clean({ types, space })
- This method is a part of the existingkibanaServer.savedObjects
API, but is new and used with the new import/export methods to delete all objects of specific types, optionally specifying something other than the default spaceAdditionally,
node scripts/kbn_archiver
exposes thekibanaServer.importExport
API for creating/loading/unloading these exports before writing tests. The CLI functions very similarly tonode scripts/es_archiver
, here is the help text for the CLI:Just like
node scripts/es_archiver
this script takes the--config
param which reads an FTR config file to know how to talk to Kibana, including SSL certs and authentication and where the exports are stored on disk for that FTR config.Thanks to @wayneseymour for getting things started in #90251