mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This reverts commit 63df7cb2e4
.
It seems this caused unintended failures on master, will resubmit after CI is green
This commit is contained in:
parent
a17c550f83
commit
b4e1193015
13 changed files with 34 additions and 122 deletions
|
@ -24,34 +24,34 @@ Options:
|
|||
|
||||
exports[`process options for run tests CLI accepts boolean value for updateBaselines 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"updateBaselines": true,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts debug option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"debug": true,
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts empty config value if default passed 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": "",
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
|
@ -60,76 +60,78 @@ Object {
|
|||
"_": Object {
|
||||
"server.foo": "bar",
|
||||
},
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": Object {
|
||||
"server.foo": "bar",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts quiet option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"quiet": true,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts silent option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"silent": true,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts source value for esFrom 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"esFrom": "source",
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts string value for kibana-install-dir 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"installDir": "foo",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts value for grep 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"grep": "management",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for run tests CLI accepts verbose option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"configs": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"verbose": true,
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -108,7 +108,7 @@ export function processOptions(userOptions, defaultConfigPaths) {
|
|||
...userOptions,
|
||||
configs,
|
||||
createLogger,
|
||||
addExtraKbnArgs: argv => argv.concat(userOptions._ || []),
|
||||
extraKbnOpts: userOptions._,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -21,22 +21,22 @@ Options:
|
|||
|
||||
exports[`process options for start servers CLI accepts debug option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"debug": true,
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts empty config value if default passed 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
|
@ -45,65 +45,67 @@ Object {
|
|||
"_": Object {
|
||||
"server.foo": "bar",
|
||||
},
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": Object {
|
||||
"server.foo": "bar",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts quiet option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"quiet": true,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts silent option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"silent": true,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts source value for esFrom 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"esFrom": "source",
|
||||
"extraKbnOpts": undefined,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts string value for kibana-install-dir 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"installDir": "foo",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`process options for start servers CLI accepts verbose option 1`] = `
|
||||
Object {
|
||||
"addExtraKbnArgs": [Function],
|
||||
"config": Array [
|
||||
"foo",
|
||||
],
|
||||
"createLogger": [Function],
|
||||
"extraKbnOpts": undefined,
|
||||
"verbose": true,
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -95,7 +95,7 @@ export function processOptions(userOptions, defaultConfigPath) {
|
|||
...userOptions,
|
||||
config,
|
||||
createLogger,
|
||||
addExtraKbnArgs: argv => argv.concat(userOptions._ || []),
|
||||
extraKbnOpts: userOptions._,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ function getKibanaCmd(installDir) {
|
|||
* passed, we run from source code. We also allow passing in extra
|
||||
* Kibana server options, so we tack those on here.
|
||||
*/
|
||||
function collectCliArgs(config, { installDir, addExtraKbnArgs }) {
|
||||
function collectCliArgs(config, { installDir, extraKbnOpts }) {
|
||||
const buildArgs = config.get('kbnTestServer.buildArgs') || [];
|
||||
const sourceArgs = config.get('kbnTestServer.sourceArgs') || [];
|
||||
const serverArgs = config.get('kbnTestServer.serverArgs') || [];
|
||||
|
@ -61,7 +61,7 @@ function collectCliArgs(config, { installDir, addExtraKbnArgs }) {
|
|||
args => {
|
||||
return installDir ? [...args, ...buildArgs] : [KIBANA_EXEC_PATH, ...args, ...sourceArgs];
|
||||
},
|
||||
addExtraKbnArgs || (args => args)
|
||||
args => args.concat(extraKbnOpts || [])
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,25 +35,6 @@ in another terminal session by running this command from this directory:
|
|||
|
||||
`;
|
||||
|
||||
/**
|
||||
* test if a list of argv flags tell the kibana server to run in the development environment
|
||||
* @param {string[]} argv
|
||||
* @return {boolean}
|
||||
*/
|
||||
function includesEnvNameDevelopmentFlag(argv) {
|
||||
return argv.some((arg, i) => {
|
||||
// find single-arg format
|
||||
if (arg === '--env.name=development') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// find split arg format
|
||||
if (arg === '--env.name' && argv[i + 1] === 'development') {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Run servers and tests for each config
|
||||
* @param {object} options Optional
|
||||
|
@ -95,12 +76,7 @@ export async function startServers(options) {
|
|||
config,
|
||||
options: {
|
||||
...opts,
|
||||
addExtraKbnArgs: argv => {
|
||||
argv = options.addExtraKbnArgs(argv);
|
||||
return !options.installDir && includesEnvNameDevelopmentFlag(argv)
|
||||
? argv.concat('--dev')
|
||||
: argv;
|
||||
},
|
||||
extraKbnOpts: [...options.extraKbnOpts, ...(options.installDir ? [] : ['--dev'])],
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
require('../src/setup_node_env');
|
||||
require('@kbn/test').runTestsCli([
|
||||
require.resolve('../test/functional_production/config.js'),
|
||||
require.resolve('../test/functional/config.js'),
|
||||
require.resolve('../test/api_integration/config.js'),
|
||||
require.resolve('../test/panel_actions/config.js'),
|
||||
|
|
|
@ -24,14 +24,6 @@ import { schema } from './schema';
|
|||
|
||||
const $values = Symbol('values');
|
||||
|
||||
function cloneConfigValue(value) {
|
||||
return cloneDeep(value, (v) => (
|
||||
typeof v === 'function'
|
||||
? v
|
||||
: undefined // tells lodash to use default behavior
|
||||
));
|
||||
}
|
||||
|
||||
export class Config {
|
||||
constructor(options = {}) {
|
||||
const {
|
||||
|
@ -94,17 +86,15 @@ export class Config {
|
|||
return recursiveHasCheck(path, this[$values], schema);
|
||||
}
|
||||
|
||||
getAll() {
|
||||
return cloneConfigValue(this[$values]);
|
||||
}
|
||||
|
||||
get(key, defaultValue) {
|
||||
if (!this.has(key)) {
|
||||
throw new Error(`Unknown config key "${key}"`);
|
||||
}
|
||||
|
||||
return cloneConfigValue(
|
||||
get(this[$values], key, defaultValue)
|
||||
);
|
||||
return cloneDeep(get(this[$values], key, defaultValue), (v) => {
|
||||
if (typeof v === 'function') {
|
||||
return v;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,18 +186,6 @@ module.exports = function (grunt) {
|
|||
],
|
||||
},
|
||||
|
||||
ossReleaseProductionSmokeTests: {
|
||||
cmd: process.execPath,
|
||||
args: [
|
||||
'scripts/functional_tests',
|
||||
'--config', 'test/functional_production/config.js',
|
||||
'--esFrom', 'source',
|
||||
'--bail',
|
||||
'--debug',
|
||||
'--kibana-install-dir', `./build/oss/kibana-${PKG_VERSION}-${process.platform}-x86_64`,
|
||||
],
|
||||
},
|
||||
|
||||
functionalTestsRelease: {
|
||||
cmd: process.execPath,
|
||||
args: [
|
||||
|
|
|
@ -41,7 +41,6 @@ module.exports = function (grunt) {
|
|||
|
||||
grunt.registerTask('jenkins:selenium', [
|
||||
'checkPlugins',
|
||||
'run:ossReleaseProductionSmokeTests',
|
||||
'run:functionalTestsRelease',
|
||||
]);
|
||||
};
|
||||
|
|
|
@ -49,7 +49,7 @@ export default function () {
|
|||
`--optimize.bundleDir=${OPTIMIZE_BUNDLE_DIR}`,
|
||||
],
|
||||
serverArgs: [
|
||||
'--env.name=development', // this arg, in this format, is required by ../functional_production/config.js
|
||||
'--env.name=development',
|
||||
'--logging.json=false',
|
||||
`--server.port=${kbnTestConfig.getPort()}`,
|
||||
`--optimize.watchPort=${kbnTestConfig.getPort() + 10}`,
|
||||
|
|
|
@ -64,14 +64,12 @@ export default async function ({ readConfigFile }) {
|
|||
require.resolve('./apps/context'),
|
||||
require.resolve('./apps/dashboard'),
|
||||
require.resolve('./apps/discover'),
|
||||
require.resolve('./apps/home'),
|
||||
require.resolve('./apps/management'),
|
||||
require.resolve('./apps/status_page'),
|
||||
require.resolve('./apps/timelion'),
|
||||
require.resolve('./apps/visualize'),
|
||||
require.resolve('./apps/xpack'),
|
||||
|
||||
// migrated to functional_production config
|
||||
// require.resolve('./apps/home')
|
||||
],
|
||||
pageObjects: {
|
||||
common: CommonPageProvider,
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export default async function ({ readConfigFile }) {
|
||||
const functionalConfig = await readConfigFile(require.resolve('../functional/config'));
|
||||
|
||||
return {
|
||||
...functionalConfig.getAll(),
|
||||
|
||||
testFiles: [
|
||||
require.resolve('../functional/apps/home'),
|
||||
],
|
||||
|
||||
junit: {
|
||||
reportName: `${functionalConfig.get('junit.reportName')} (Production)`
|
||||
},
|
||||
|
||||
kbnTestServer: {
|
||||
...functionalConfig.get('kbnTestServer'),
|
||||
|
||||
serverArgs: functionalConfig.get('kbnTestServer.serverArgs').filter(arg => (
|
||||
arg !== '--env.name=development'
|
||||
)),
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue