mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Move shareable component sandbox to its own plugin * Add newline and fix test * disable lint for no-default-export on example tests * Fix lint * Address feedback * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
/*
|
|
* 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; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import { FtrConfigProviderContext } from '@kbn/test';
|
|
import { resolve } from 'path';
|
|
import fs from 'fs';
|
|
import { REPO_ROOT as KIBANA_ROOT } from '@kbn/utils';
|
|
|
|
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|
const xpackFunctionalConfig = await readConfigFile(
|
|
require.resolve('../functional/config.base.js')
|
|
);
|
|
|
|
// 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()
|
|
);
|
|
|
|
const xpackExamplesFiles = fs.readdirSync(resolve(KIBANA_ROOT, 'x-pack/examples'));
|
|
const xpackExamples = xpackExamplesFiles.filter((file) =>
|
|
fs.statSync(resolve(KIBANA_ROOT, 'x-pack/examples', file)).isDirectory()
|
|
);
|
|
|
|
return {
|
|
// default to the xpack functional config
|
|
...xpackFunctionalConfig.getAll(),
|
|
|
|
junit: {
|
|
reportName: 'X-Pack Example plugin functional tests',
|
|
},
|
|
|
|
testFiles: [
|
|
require.resolve('./search_examples'),
|
|
require.resolve('./embedded_lens'),
|
|
require.resolve('./reporting_examples'),
|
|
require.resolve('./screenshotting'),
|
|
require.resolve('./triggers_actions_ui_examples'),
|
|
],
|
|
|
|
kbnTestServer: {
|
|
...xpackFunctionalConfig.get('kbnTestServer'),
|
|
|
|
serverArgs: [
|
|
...xpackFunctionalConfig.get('kbnTestServer.serverArgs'),
|
|
// Required to load new platform plugins via `--plugin-path` flag.
|
|
'--env.name=development',
|
|
...examples.map(
|
|
(exampleDir) => `--plugin-path=${resolve(KIBANA_ROOT, 'examples', exampleDir)}`
|
|
),
|
|
...xpackExamples.map(
|
|
(exampleDir) => `--plugin-path=${resolve(KIBANA_ROOT, 'x-pack/examples', exampleDir)}`
|
|
),
|
|
],
|
|
},
|
|
};
|
|
}
|