Revert "Run some functional tests against kibana in production mode (#21899)" (#22111)

This reverts commit 63df7cb2e4.

It seems this caused unintended failures on master, will resubmit after CI is green
This commit is contained in:
Spencer 2018-08-16 23:28:37 -07:00 committed by GitHub
parent a17c550f83
commit b4e1193015
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 34 additions and 122 deletions

View file

@ -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,
}
`;

View file

@ -108,7 +108,7 @@ export function processOptions(userOptions, defaultConfigPaths) {
...userOptions,
configs,
createLogger,
addExtraKbnArgs: argv => argv.concat(userOptions._ || []),
extraKbnOpts: userOptions._,
};
}

View file

@ -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,
}
`;

View file

@ -95,7 +95,7 @@ export function processOptions(userOptions, defaultConfigPath) {
...userOptions,
config,
createLogger,
addExtraKbnArgs: argv => argv.concat(userOptions._ || []),
extraKbnOpts: userOptions._,
};
}

View file

@ -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 || [])
);
}

View file

@ -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'])],
},
});

View file

@ -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'),

View file

@ -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;
}
});
}
}

View file

@ -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: [

View file

@ -41,7 +41,6 @@ module.exports = function (grunt) {
grunt.registerTask('jenkins:selenium', [
'checkPlugins',
'run:ossReleaseProductionSmokeTests',
'run:functionalTestsRelease',
]);
};

View file

@ -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}`,

View file

@ -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,

View file

@ -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'
)),
},
};
}