From 2543a17a5310f9dc841466a19bb61d6b5499403e Mon Sep 17 00:00:00 2001 From: LeeDr Date: Wed, 5 Sep 2018 14:33:00 -0500 Subject: [PATCH 1/2] x-pack tests should use servers from other config files already loaded --- x-pack/test/functional/config.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 5f4cb60fa81e8..77c0aee49b83e 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -7,7 +7,6 @@ /* eslint-disable kibana-custom/no-default-export */ import { resolve } from 'path'; -import { format as formatUrl } from 'url'; import { SecurityPageProvider, @@ -57,25 +56,6 @@ export default async function ({ readConfigFile }) { const kibanaFunctionalConfig = await readConfigFile(require.resolve('../../../test/functional/config.js')); const kibanaAPITestsConfig = await readConfigFile(require.resolve('../../../test/api_integration/config.js')); - const servers = { - elasticsearch: { - protocol: process.env.TEST_ES_PROTOCOL || 'http', - hostname: process.env.TEST_ES_HOSTNAME || 'localhost', - port: parseInt(process.env.TEST_ES_PORT, 10) || 9240, - auth: 'elastic:changeme', - username: 'elastic', - password: 'changeme', - }, - kibana: { - protocol: process.env.TEST_KIBANA_PROTOCOL || 'http', - hostname: process.env.TEST_KIBANA_HOSTNAME || 'localhost', - port: parseInt(process.env.TEST_KIBANA_PORT, 10) || 5640, - auth: 'elastic:changeme', - username: 'elastic', - password: 'changeme', - }, - }; - return { // list paths to the files that contain your plugins tests testFiles: [ @@ -135,7 +115,7 @@ export default async function ({ readConfigFile }) { reporting: ReportingPageProvider, }, - servers, + servers: kibanaFunctionalConfig.get('servers'), esTestCluster: { license: 'trial', @@ -151,8 +131,6 @@ export default async function ({ readConfigFile }) { serverArgs: [ ...kibanaCommonConfig.get('kbnTestServer.serverArgs'), '--server.uuid=5b2de169-2785-441b-ae8c-186a1936b17d', - `--server.port=${servers.kibana.port}`, - `--elasticsearch.url=${formatUrl(servers.elasticsearch)}`, '--xpack.xpack_main.telemetry.enabled=false', '--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions ], From eff263ef680af3aa34e49ab2b461ea388377c0b0 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Wed, 5 Sep 2018 14:52:54 -0500 Subject: [PATCH 2/2] Fix es_test_config that was using TEST_KIBANA_USERNAME/PASSWORD --- packages/kbn-test/src/es/es_test_config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.js b/packages/kbn-test/src/es/es_test_config.js index 2e9e91e50b4b2..e273172ef614b 100644 --- a/packages/kbn-test/src/es/es_test_config.js +++ b/packages/kbn-test/src/es/es_test_config.js @@ -53,8 +53,9 @@ export const esTestConfig = new class EsTestConfig { }; } - const username = process.env.TEST_KIBANA_USERNAME || adminTestUser.username; - const password = process.env.TEST_KIBANA_PASSWORD || adminTestUser.password; + const username = process.env.TEST_ES_USERNAME || adminTestUser.username; + const password = process.env.TEST_ES_PASSWORD || adminTestUser.password; + return { // Allow setting any individual component(s) of the URL, // or use default values (username and password from ../kbn/users.js)