mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
The location of plugins was previously somewhat irrelevant, but as we move into packages it's more important that we can find all plugins in the repository, and we would like to be able to do that without needing to maintain a manifest somewhere to accomplish this. In order to make this possible we plan to find any plugin/package by spotting all kibana.json files which are not "fixtures". This allows plugin-like code (but not actual plugin code) to exist for testing purposes, but it must be within some form of "fixtures" directory, and any plugin that isn't in a fixtures directory will be automatically pulled into the system (though test plugins, examples, etc. will still only be loaded when the plugin's path is passed via `--plugin-path`, the system will know about them and use that knowledge for other things). Since this is just a rename Operations will review and merge by EOD Jan 12th unless someone has a blocking concern. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
54 lines
2.2 KiB
TypeScript
54 lines
2.2 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 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 fs from 'fs';
|
|
import path from 'path';
|
|
import { FtrConfigProviderContext } from '@kbn/test';
|
|
|
|
/*
|
|
* These tests exist in a separate configuration because:
|
|
* 1) It must run as the first test after Kibana launches to clear the unavailable status. A separate config makes this
|
|
* easier to manage and prevent from breaking.
|
|
* 2) The other server_integration tests run against a built distributable, however the FTR does not support building
|
|
* and installing plugins against built Kibana. This test must be run against source only in order to build the
|
|
* fixture plugins
|
|
*/
|
|
// eslint-disable-next-line import/no-default-export
|
|
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|
const httpConfig = await readConfigFile(require.resolve('../../config.base.js'));
|
|
|
|
// Find all folders in plugins since we treat all them as plugin folder
|
|
const pluginDir = path.resolve(__dirname, '../../plugins');
|
|
const pluginsDirs = fs.readdirSync(pluginDir).map((name) => path.resolve(pluginDir, name));
|
|
|
|
return {
|
|
testFiles: [
|
|
// Status test should be first to resolve manually created "unavailable" plugin
|
|
require.resolve('./status'),
|
|
],
|
|
services: httpConfig.get('services'),
|
|
servers: httpConfig.get('servers'),
|
|
junit: {
|
|
reportName: 'Kibana Platform Status Integration Tests',
|
|
},
|
|
esTestCluster: httpConfig.get('esTestCluster'),
|
|
kbnTestServer: {
|
|
...httpConfig.get('kbnTestServer'),
|
|
serverArgs: [
|
|
...httpConfig.get('kbnTestServer.serverArgs'),
|
|
...pluginsDirs.map((p) => `--plugin-path=${p}`),
|
|
],
|
|
runOptions: {
|
|
...httpConfig.get('kbnTestServer.runOptions'),
|
|
// Don't wait for Kibana to be completely ready so that we can test the status timeouts
|
|
wait: /Kibana is now unavailable/,
|
|
alwaysUseSource: true,
|
|
},
|
|
},
|
|
};
|
|
}
|