kibana/test/examples/config.js
Anton Dosov 2e171759ca
[CM] Example plugin with server-side registry usage (#151885)
## Summary

Close https://github.com/elastic/kibana/issues/152002

In https://github.com/elastic/kibana/pull/151163 we introduced a simple
demo todo app run in a storybook with a custom client-side content
management client (no server-side cm registry usage).
This is a follow-up PR that re-uses the same demo todo app, but also
runs it in an example plugin with proper server-side content management
registry usage, so now we have a basic end-to-end demonstration of
content management capabilities. The demo app is covered by functional
tests, so now we also have basic end-to-end test coverage.


As this is the first kind of real-world end-to-end usage of the CM APIs,
I'd like to use this and
[previous](https://github.com/elastic/kibana/pull/151163) prs as a base
for the discussion and polishing current APIs. I'll leave a review with
comments where I think some API polishing is needed.


**Notable changes apart from the example plugin itself:** 

1. Move `demo/` todo app and its stories introduced in
https://github.com/elastic/kibana/pull/151163 from
`src/plugins/content_management` to
`examples/content_management_examples`. This was mostly needed to not
export `demo/` code on the public plugin export to avoid increasing
bundle size.
2. Add needed exports to the plugin contract 
3. Reshuffle `common/` to not import `@kbn/schema` client side
48aa41403b
4. Fix client-side RPC client to work with the latest server-side
changes (shouldn't break from now on because of the end-to-end test
coverage)
2023-02-28 14:57:57 +01:00

65 lines
2.2 KiB
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { resolve } from 'path';
import { REPO_ROOT } from '@kbn/repo-info';
import { findTestPluginPaths } from '@kbn/test';
import { services } from '../plugin_functional/services';
export default async function ({ readConfigFile }) {
const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js'));
return {
rootTags: ['runOutsideOfCiGroups'],
testFiles: [
require.resolve('./hello_world'),
require.resolve('./embeddables'),
require.resolve('./bfetch_explorer'),
require.resolve('./ui_actions'),
require.resolve('./state_sync'),
require.resolve('./routing'),
require.resolve('./expressions_explorer'),
require.resolve('./data_view_field_editor_example'),
require.resolve('./field_formats'),
require.resolve('./partial_results'),
require.resolve('./search'),
require.resolve('./content_management'),
],
services: {
...functionalConfig.get('services'),
...services,
},
uiSettings: {
defaults: {
'accessibility:disableAnimations': true,
'dateFormat:tz': 'UTC',
},
},
pageObjects: functionalConfig.get('pageObjects'),
servers: functionalConfig.get('servers'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
apps: functionalConfig.get('apps'),
screenshots: functionalConfig.get('screenshots'),
junit: {
reportName: 'Example plugin functional tests',
},
kbnTestServer: {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
...functionalConfig.get('kbnTestServer.serverArgs'),
// Required to load new platform plugins via `--plugin-path` flag.
'--env.name=development',
'--telemetry.optIn=false',
...findTestPluginPaths(resolve(REPO_ROOT, 'examples')),
],
},
};
}