mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[kbn-test] convert kibana-install-dir flag to installDir option (#21317)
* [kbn-test] convert kibana-install-dir flag to installDir option
* [kbn-test] replicate kibana-install-dir handling to startServers
* [ftr] try running functional tests in production in CI
* Revert "[ftr] try running functional tests in production in CI"
This reverts commit e5b94aa024
.
* [core/public/legacyPlatform] exclude ui/test_harness from the distributable
* [optimizer] fix `process.env.IS_KIBANA_DISTRIBUTABLE` definition
* [optimizer] only define `process.env.IS_KIBANA_DISTRIBUTABLE` when needed
Adding a `webpack.DefinePlugin` slows down the optimizer a small amount,
so only apply it when it is necessary, and skip it if it is going to
be defined as "false".
* [kbn-test/startServer] don't run in --dev mode if running from dist
* [ftr/kibanaServer/version] attach `-SNAPSHOT` suffix to version if running build_snapshot
This commit is contained in:
parent
a207d97ce3
commit
4f0d2ade1e
9 changed files with 32 additions and 10 deletions
|
@ -110,7 +110,7 @@ Object {
|
|||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"kibana-install-dir": "foo",
|
||||
"installDir": "foo",
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
|
@ -93,6 +93,11 @@ export function processOptions(userOptions, defaultConfigPaths) {
|
|||
}
|
||||
}
|
||||
|
||||
if (userOptions['kibana-install-dir']) {
|
||||
userOptions.installDir = userOptions['kibana-install-dir'];
|
||||
delete userOptions['kibana-install-dir'];
|
||||
}
|
||||
|
||||
function createLogger() {
|
||||
const log = createToolingLog(pickLevelFromFlags(userOptions));
|
||||
log.pipe(process.stdout);
|
||||
|
|
|
@ -95,7 +95,7 @@ Object {
|
|||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"kibana-install-dir": "foo",
|
||||
"installDir": "foo",
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
|
@ -80,6 +80,11 @@ export function processOptions(userOptions, defaultConfigPath) {
|
|||
throw new Error(`functional_tests_server: config is required`);
|
||||
}
|
||||
|
||||
if (userOptions['kibana-install-dir']) {
|
||||
userOptions.installDir = userOptions['kibana-install-dir'];
|
||||
delete userOptions['kibana-install-dir'];
|
||||
}
|
||||
|
||||
function createLogger() {
|
||||
const log = createToolingLog(pickLevelFromFlags(userOptions));
|
||||
log.pipe(process.stdout);
|
||||
|
|
|
@ -76,7 +76,7 @@ export async function startServers(options) {
|
|||
config,
|
||||
options: {
|
||||
...opts,
|
||||
extraKbnOpts: [...options.extraKbnOpts, '--dev'],
|
||||
extraKbnOpts: [...options.extraKbnOpts, ...(options.installDir ? [] : ['--dev'])],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
require('../src/setup_node_env');
|
||||
require('../packages/kbn-test').runTestsCli([
|
||||
require('@kbn/test').runTestsCli([
|
||||
require.resolve('../test/functional/config.js'),
|
||||
require.resolve('../test/api_integration/config.js'),
|
||||
require.resolve('../test/panel_actions/config.js'),
|
||||
|
|
|
@ -81,7 +81,7 @@ export class LegacyPlatformService {
|
|||
if (this.params.useLegacyTestHarness) {
|
||||
// wrapped in NODE_ENV check so the `ui/test_harness` module
|
||||
// is not included in the distributable
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (process.env.IS_KIBANA_DISTRIBUTABLE !== 'true') {
|
||||
return require('ui/test_harness');
|
||||
}
|
||||
|
||||
|
|
|
@ -281,8 +281,20 @@ export default class BaseOptimizer {
|
|||
},
|
||||
};
|
||||
|
||||
// we transpile typescript in the optimizer unless we are running the distributable
|
||||
const transpileTsConfig = {
|
||||
// when running from the distributable define an environment variable we can use
|
||||
// to exclude chunks of code, modules, etc.
|
||||
const isDistributableConfig = {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'IS_KIBANA_DISTRIBUTABLE': `"true"`
|
||||
}
|
||||
}),
|
||||
]
|
||||
};
|
||||
|
||||
// when running from source transpile TypeScript automatically
|
||||
const isSourceConfig = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
@ -366,8 +378,8 @@ export default class BaseOptimizer {
|
|||
return webpackMerge(
|
||||
commonConfig,
|
||||
IS_KIBANA_DISTRIBUTABLE
|
||||
? {}
|
||||
: transpileTsConfig,
|
||||
? isDistributableConfig
|
||||
: isSourceConfig,
|
||||
this.uiBundles.isDevMode()
|
||||
? webpackMerge(watchingConfig, supportEnzymeConfig)
|
||||
: productionConfig
|
||||
|
|
|
@ -30,7 +30,7 @@ export class KibanaServerVersion {
|
|||
|
||||
const status = await this.kibanaStatus.get();
|
||||
if (status && status.version && status.version.number) {
|
||||
this._cachedVersionNumber = status.version.number;
|
||||
this._cachedVersionNumber = status.version.number + (status.version.build_snapshot ? '-SNAPSHOT' : '');
|
||||
return this._cachedVersionNumber;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue