2019-12-11 16:38:49 +01:00
|
|
|
/*
|
2021-01-20 02:54:11 +01:00
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
2021-02-04 03:39:13 +01:00
|
|
|
* 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.
|
2019-12-11 16:38:49 +01:00
|
|
|
*/
|
|
|
|
|
2021-06-09 04:45:04 +02:00
|
|
|
import { resolve } from 'path';
|
2019-12-11 16:38:49 +01:00
|
|
|
import { services } from '../plugin_functional/services';
|
2021-03-15 17:09:58 +01:00
|
|
|
import fs from 'fs';
|
|
|
|
import { KIBANA_ROOT } from '@kbn/test';
|
2019-12-11 16:38:49 +01:00
|
|
|
|
2020-05-22 10:08:13 +02:00
|
|
|
export default async function ({ readConfigFile }) {
|
2019-12-11 16:38:49 +01:00
|
|
|
const functionalConfig = await readConfigFile(require.resolve('../functional/config'));
|
|
|
|
|
2021-03-15 17:09:58 +01:00
|
|
|
// Find all folders in /examples and /x-pack/examples since we treat all them as plugin folder
|
|
|
|
const examplesFiles = fs.readdirSync(resolve(KIBANA_ROOT, 'examples'));
|
|
|
|
const examples = examplesFiles.filter((file) =>
|
|
|
|
fs.statSync(resolve(KIBANA_ROOT, 'examples', file)).isDirectory()
|
|
|
|
);
|
|
|
|
|
2019-12-11 16:38:49 +01:00
|
|
|
return {
|
2020-02-11 18:01:37 +01:00
|
|
|
testFiles: [
|
|
|
|
require.resolve('./embeddables'),
|
2020-06-10 13:55:11 +02:00
|
|
|
require.resolve('./bfetch_explorer'),
|
2020-02-11 18:01:37 +01:00
|
|
|
require.resolve('./ui_actions'),
|
2020-04-21 15:56:14 +02:00
|
|
|
require.resolve('./state_sync'),
|
2020-07-15 21:00:15 +02:00
|
|
|
require.resolve('./routing'),
|
2021-01-23 06:29:13 +01:00
|
|
|
require.resolve('./expressions_explorer'),
|
2021-06-12 05:40:40 +02:00
|
|
|
require.resolve('./index_pattern_field_editor_example'),
|
2020-02-11 18:01:37 +01:00
|
|
|
],
|
2019-12-11 16:38:49 +01:00
|
|
|
services: {
|
|
|
|
...functionalConfig.get('services'),
|
|
|
|
...services,
|
|
|
|
},
|
2020-02-20 00:06:01 +01:00
|
|
|
uiSettings: {
|
|
|
|
defaults: {
|
|
|
|
'accessibility:disableAnimations': true,
|
|
|
|
'dateFormat:tz': 'UTC',
|
|
|
|
'telemetry:optIn': false,
|
|
|
|
},
|
|
|
|
},
|
2019-12-11 16:38:49 +01:00
|
|
|
pageObjects: functionalConfig.get('pageObjects'),
|
|
|
|
servers: functionalConfig.get('servers'),
|
2021-02-09 07:57:34 +01:00
|
|
|
esTestCluster: {
|
|
|
|
...functionalConfig.get('esTestCluster'),
|
|
|
|
serverArgs: ['xpack.security.enabled=false'],
|
|
|
|
},
|
2019-12-11 16:38:49 +01:00
|
|
|
apps: functionalConfig.get('apps'),
|
|
|
|
screenshots: functionalConfig.get('screenshots'),
|
|
|
|
junit: {
|
|
|
|
reportName: 'Example plugin functional tests',
|
|
|
|
},
|
|
|
|
kbnTestServer: {
|
|
|
|
...functionalConfig.get('kbnTestServer'),
|
|
|
|
serverArgs: [
|
|
|
|
...functionalConfig.get('kbnTestServer.serverArgs'),
|
2021-03-15 17:09:58 +01:00
|
|
|
// Required to load new platform plugins via `--plugin-path` flag.
|
2019-12-11 16:38:49 +01:00
|
|
|
'--env.name=development',
|
2021-03-15 17:09:58 +01:00
|
|
|
...examples.map(
|
|
|
|
(exampleDir) => `--plugin-path=${resolve(KIBANA_ROOT, 'examples', exampleDir)}`
|
|
|
|
),
|
2019-12-11 16:38:49 +01:00
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|