Migrate most plugins to synchronous lifecycle (#89562)

* first pass

* migrate more plugins

* migrate yet more plugins

* more oss plugins

* fix test file

* change Plugin signature on the client-side too

* fix test types

* migrate OSS client-side plugins

* migrate OSS client-side test plugins

* migrate xpack client-side plugins

* revert fix attempt on fleet plugin

* fix presentation start signature

* fix yet another signature

* add warnings for server-side async plugins in dev mode

* remove unused import

* fix isPromise

* Add client-side deprecations

* update migration examples

* update generated doc

* fix xpack unit tests

* nit

* (will be reverted) explicitly await for license to be ready in the auth hook

* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"

This reverts commit fdf73feb

* restore await on on promise contracts

* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"

This reverts commit fdf73feb

* Revert "restore await on on promise contracts"

This reverts commit c5f2fe51

* add delay before starting tests in FTR

* update deprecation ts doc

* add explicit contract for monitoring setup

* migrate monitoring plugin to sync

* change plugin timeout to 10sec

* use delay instead of silence
This commit is contained in:
Pierre Gayvallet 2021-02-08 10:19:54 +01:00 committed by GitHub
parent 2279c06d1e
commit 3b3327dbc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
114 changed files with 1001 additions and 551 deletions

View file

@ -6,7 +6,7 @@
*/
import { coreMock, savedObjectsServiceMock } from 'src/core/server/mocks';
import { Plugin } from './plugin';
import { FeaturesPlugin } from './plugin';
describe('Features Plugin', () => {
let initContext: ReturnType<typeof coreMock.createPluginInitializerContext>;
@ -31,7 +31,7 @@ describe('Features Plugin', () => {
});
it('returns OSS + registered kibana features', async () => {
const plugin = new Plugin(initContext);
const plugin = new FeaturesPlugin(initContext);
const { registerKibanaFeature } = await plugin.setup(coreSetup, {});
registerKibanaFeature({
id: 'baz',
@ -58,7 +58,7 @@ describe('Features Plugin', () => {
});
it('returns OSS + registered kibana features with timelion when available', async () => {
const plugin = new Plugin(initContext);
const plugin = new FeaturesPlugin(initContext);
const { registerKibanaFeature: registerFeature } = await plugin.setup(coreSetup, {
visTypeTimelion: { uiEnabled: true },
});
@ -88,7 +88,7 @@ describe('Features Plugin', () => {
});
it('registers kibana features with not hidden saved objects types', async () => {
const plugin = new Plugin(initContext);
const plugin = new FeaturesPlugin(initContext);
await plugin.setup(coreSetup, {});
const { getKibanaFeatures } = plugin.start(coreStart);
@ -101,7 +101,7 @@ describe('Features Plugin', () => {
});
it('returns registered elasticsearch features', async () => {
const plugin = new Plugin(initContext);
const plugin = new FeaturesPlugin(initContext);
const { registerElasticsearchFeature } = await plugin.setup(coreSetup, {});
registerElasticsearchFeature({
id: 'baz',
@ -123,7 +123,7 @@ describe('Features Plugin', () => {
});
it('registers a capabilities provider', async () => {
const plugin = new Plugin(initContext);
const plugin = new FeaturesPlugin(initContext);
await plugin.setup(coreSetup, {});
expect(coreSetup.capabilities.registerProvider).toHaveBeenCalledTimes(1);