server logs config paths to use for runner (#52980)

* server logs config paths to use for runner

* fix eslint issue

* do not log config path for default config

* update snapshots

* fix other tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Mikhail Shustov 2020-10-17 10:48:58 +03:00 committed by GitHub
parent 72fa61ba71
commit ef2be2c725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -26,6 +26,7 @@ Object {
"debug": true,
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
}
`;
@ -35,6 +36,7 @@ Object {
"createLogger": [Function],
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
}
`;
@ -49,6 +51,7 @@ Object {
"extraKbnOpts": Object {
"server.foo": "bar",
},
"useDefaultConfig": true,
}
`;
@ -59,6 +62,7 @@ Object {
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"quiet": true,
"useDefaultConfig": true,
}
`;
@ -69,6 +73,7 @@ Object {
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"silent": true,
"useDefaultConfig": true,
}
`;
@ -78,6 +83,7 @@ Object {
"createLogger": [Function],
"esFrom": "source",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
}
`;
@ -87,6 +93,7 @@ Object {
"createLogger": [Function],
"esFrom": "source",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
}
`;
@ -97,6 +104,7 @@ Object {
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"installDir": "foo",
"useDefaultConfig": true,
}
`;
@ -106,6 +114,7 @@ Object {
"createLogger": [Function],
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
"verbose": true,
}
`;
@ -116,5 +125,6 @@ Object {
"createLogger": [Function],
"esFrom": "snapshot",
"extraKbnOpts": undefined,
"useDefaultConfig": true,
}
`;

View file

@ -75,7 +75,8 @@ export function displayHelp() {
export function processOptions(userOptions, defaultConfigPath) {
validateOptions(userOptions);
const config = userOptions.config || defaultConfigPath;
const useDefaultConfig = !userOptions.config;
const config = useDefaultConfig ? defaultConfigPath : userOptions.config;
if (!config) {
throw new Error(`functional_tests_server: config is required`);
@ -100,6 +101,7 @@ export function processOptions(userOptions, defaultConfigPath) {
return {
...userOptions,
config: resolve(config),
useDefaultConfig,
createLogger,
extraKbnOpts: userOptions._,
};

View file

@ -36,6 +36,13 @@ import { readConfigFile } from '../functional_test_runner/lib';
const makeSuccessMessage = (options) => {
const installDirFlag = options.installDir ? ` --kibana-install-dir=${options.installDir}` : '';
const configPaths = Array.isArray(options.config) ? options.config : [options.config];
const pathsMessage = options.useDefaultConfig
? ''
: configPaths
.map((path) => relative(process.cwd(), path))
.map((path) => ` --config ${path}`)
.join('');
return (
'\n\n' +
@ -43,7 +50,7 @@ const makeSuccessMessage = (options) => {
Elasticsearch and Kibana are ready for functional testing. Start the functional tests
in another terminal session by running this command from this directory:
node ${relative(process.cwd(), KIBANA_FTR_SCRIPT)}${installDirFlag}
node ${relative(process.cwd(), KIBANA_FTR_SCRIPT)}${installDirFlag}${pathsMessage}
` +
'\n\n'
);