[Code] Disable xpack.code.ui.enabled instead of xpack.code.enabled (#38919)

* [Code] Disable xpack.code.ui.enabled instead of xpack.code.enabled

* Revert "[Code]: disable code by default in 7.2 (#38757) (#38801)"

This reverts commit f6f2d7d2bb.

* Flip xpack.code.ui.enabled in tests
This commit is contained in:
Mengwei Ding 2019-06-13 13:19:54 -07:00 committed by GitHub
parent a17fab0357
commit 38e508ff45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 9 deletions

View file

@ -37,9 +37,9 @@ export const code = (kibana: any) =>
config(Joi: typeof JoiNamespace) { config(Joi: typeof JoiNamespace) {
return Joi.object({ return Joi.object({
ui: Joi.object({ ui: Joi.object({
enabled: Joi.boolean().default(true), enabled: Joi.boolean().default(false),
}).default(), }).default(),
enabled: Joi.boolean().default(false), enabled: Joi.boolean().default(true),
queueIndex: Joi.string().default('.code_internal-worker-queue'), queueIndex: Joi.string().default('.code_internal-worker-queue'),
// 1 hour by default. // 1 hour by default.
queueTimeoutMs: Joi.number().default(moment.duration(1, 'hour').asMilliseconds()), queueTimeoutMs: Joi.number().default(moment.duration(1, 'hour').asMilliseconds()),

View file

@ -85,7 +85,12 @@ describe('code in multiple nodes', () => {
port: codePort, port: codePort,
}, },
plugins: { paths: [pluginPaths] }, plugins: { paths: [pluginPaths] },
xpack: xpackOption, xpack: {
...xpackOption,
code: {
ui: { enabled: true },
},
},
}, },
}, },
}); });
@ -102,7 +107,10 @@ describe('code in multiple nodes', () => {
plugins: { paths: [pluginPaths] }, plugins: { paths: [pluginPaths] },
xpack: { xpack: {
...xpackOption, ...xpackOption,
code: { codeNodeUrl: `http://localhost:${codePort}` }, code: {
ui: { enabled: true },
codeNodeUrl: `http://localhost:${codePort}`,
},
}, },
}; };
nonCodeNode = createRootWithCorePlugins(setting); nonCodeNode = createRootWithCorePlugins(setting);

View file

@ -26,9 +26,9 @@ function getPluginPaths(plugins, opts = {}) {
const publicPaths = `plugins/${publicPath}/**/${testPath}/*.js`; const publicPaths = `plugins/${publicPath}/**/${testPath}/*.js`;
paths = paths.concat([indexPaths, commonPaths, serverPaths]); paths = paths.concat([indexPaths, commonPaths, serverPaths]);
// if(plugin === 'code') { if(plugin === 'code') {
// paths.push(`plugins/${serverPath}/**/${testPath}/*.ts`); paths.push(`plugins/${serverPath}/**/${testPath}/*.ts`);
// } }
if (opts.browser) { if (opts.browser) {
paths = paths.concat(publicPaths); paths = paths.concat(publicPaths);
} }

View file

@ -22,7 +22,7 @@ export default function ({ loadTestFile }) {
loadTestFile(require.resolve('./maps')); loadTestFile(require.resolve('./maps'));
loadTestFile(require.resolve('./apm')); loadTestFile(require.resolve('./apm'));
loadTestFile(require.resolve('./siem')); loadTestFile(require.resolve('./siem'));
// loadTestFile(require.resolve('./code')); loadTestFile(require.resolve('./code'));
loadTestFile(require.resolve('./short_urls')); loadTestFile(require.resolve('./short_urls'));
}); });
} }

View file

@ -129,6 +129,7 @@ export default function({ getService }: KibanaFunctionalTestDefaultProviders) {
'ml', 'ml',
'apm', 'apm',
'canvas', 'canvas',
'code',
'infrastructure', 'infrastructure',
'logs', 'logs',
'maps', 'maps',

View file

@ -62,6 +62,7 @@ export default async function ({ readConfigFile }) {
serverArgs: [ serverArgs: [
...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), ...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'),
'--optimize.enabled=false', '--optimize.enabled=false',
'--xpack.code.ui.enabled=true', // Enable Code Ui just in tests
], ],
}, },
esTestCluster: { esTestCluster: {

View file

@ -102,7 +102,7 @@ export default async function ({ readConfigFile }) {
resolve(__dirname, './apps/status_page'), resolve(__dirname, './apps/status_page'),
resolve(__dirname, './apps/timelion'), resolve(__dirname, './apps/timelion'),
resolve(__dirname, './apps/upgrade_assistant'), resolve(__dirname, './apps/upgrade_assistant'),
// resolve(__dirname, './apps/code'), resolve(__dirname, './apps/code'),
resolve(__dirname, './apps/visualize'), resolve(__dirname, './apps/visualize'),
resolve(__dirname, './apps/uptime'), resolve(__dirname, './apps/uptime'),
resolve(__dirname, './apps/saved_objects_management'), resolve(__dirname, './apps/saved_objects_management'),
@ -194,6 +194,7 @@ export default async function ({ readConfigFile }) {
'--xpack.maps.showMapsInspectorAdapter=true', '--xpack.maps.showMapsInspectorAdapter=true',
'--stats.maximumWaitTimeForAllCollectorsInS=0', '--stats.maximumWaitTimeForAllCollectorsInS=0',
'--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions '--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions
'--xpack.code.ui.enabled=true', // Enable Code Ui just in tests
'--xpack.code.security.enableGitCertCheck=false', // Disable git certificate check '--xpack.code.security.enableGitCertCheck=false', // Disable git certificate check
'--timelion.ui.enabled=true', '--timelion.ui.enabled=true',
], ],