From 9cb5c4e2ea7728ca1a8f06a4fcfeb01c4de9d6a5 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Wed, 5 Sep 2018 19:54:38 -0500 Subject: [PATCH 1/4] merge to 6.4 --- packages/kbn-test/src/es/es_test_config.js | 5 ++-- x-pack/test/functional/config.js | 34 ++++------------------ 2 files changed, 8 insertions(+), 31 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) diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 3f6ed366fac86..76471e7048e5e 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,33 +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', - }, - }; - - const env = { - kibana: { - server: { - uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', // Kibana UUID for "primary" cluster in monitoring data - } - } - }; - return { // list paths to the files that contain your plugins tests testFiles: [ @@ -143,7 +115,7 @@ export default async function ({ readConfigFile }) { reporting: ReportingPageProvider, }, - servers, + servers: kibanaFunctionalConfig.get('servers'), env, @@ -160,9 +132,13 @@ export default async function ({ readConfigFile }) { ...kibanaCommonConfig.get('kbnTestServer'), serverArgs: [ ...kibanaCommonConfig.get('kbnTestServer.serverArgs'), +<<<<<<< HEAD `--server.uuid=${env.kibana.server.uuid}`, `--server.port=${servers.kibana.port}`, `--elasticsearch.url=${formatUrl(servers.elasticsearch)}`, +======= + '--server.uuid=5b2de169-2785-441b-ae8c-186a1936b17d', +>>>>>>> eeee0d800a... x-pack tests should use servers from other config files already loaded (#22739) '--xpack.xpack_main.telemetry.enabled=false', '--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions ], From 6b040d2b0f6f9a051ff46fc1c810e9d06c7d0b14 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Thu, 6 Sep 2018 11:38:10 -0500 Subject: [PATCH 2/4] resolve merge issue I'm not 100% sure on `--server.uuid`. This is different from master and 6.x where we have '--server.uuid=5b2de169-2785-441b-ae8c-186a1936b17d', --- x-pack/test/functional/config.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 76471e7048e5e..5e2c3c5a7d062 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -132,13 +132,7 @@ export default async function ({ readConfigFile }) { ...kibanaCommonConfig.get('kbnTestServer'), serverArgs: [ ...kibanaCommonConfig.get('kbnTestServer.serverArgs'), -<<<<<<< HEAD `--server.uuid=${env.kibana.server.uuid}`, - `--server.port=${servers.kibana.port}`, - `--elasticsearch.url=${formatUrl(servers.elasticsearch)}`, -======= - '--server.uuid=5b2de169-2785-441b-ae8c-186a1936b17d', ->>>>>>> eeee0d800a... x-pack tests should use servers from other config files already loaded (#22739) '--xpack.xpack_main.telemetry.enabled=false', '--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions ], From 03d9fb782a7a931632666b9fa17ddf7463ae5773 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Mon, 10 Sep 2018 11:17:33 -0500 Subject: [PATCH 3/4] Add env object back in. --- packages/kbn-test/src/es/es_test_config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/kbn-test/src/es/es_test_config.js b/packages/kbn-test/src/es/es_test_config.js index e273172ef614b..57b968cea02aa 100644 --- a/packages/kbn-test/src/es/es_test_config.js +++ b/packages/kbn-test/src/es/es_test_config.js @@ -56,6 +56,14 @@ export const esTestConfig = new class EsTestConfig { const username = process.env.TEST_ES_USERNAME || adminTestUser.username; const password = process.env.TEST_ES_PASSWORD || adminTestUser.password; + const env = { + kibana: { + server: { + uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', // Kibana UUID for "primary" cluster in monitoring data + } + } + }; + return { // Allow setting any individual component(s) of the URL, // or use default values (username and password from ../kbn/users.js) From a26e37d80dfb22a7bf6dbee8ebaec3871fa91b8a Mon Sep 17 00:00:00 2001 From: LeeDr Date: Tue, 11 Sep 2018 16:10:45 -0500 Subject: [PATCH 4/4] Move env from es_test_config to x-pack/test/functional/config --- packages/kbn-test/src/es/es_test_config.js | 8 -------- x-pack/test/functional/config.js | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.js b/packages/kbn-test/src/es/es_test_config.js index 57b968cea02aa..e273172ef614b 100644 --- a/packages/kbn-test/src/es/es_test_config.js +++ b/packages/kbn-test/src/es/es_test_config.js @@ -56,14 +56,6 @@ export const esTestConfig = new class EsTestConfig { const username = process.env.TEST_ES_USERNAME || adminTestUser.username; const password = process.env.TEST_ES_PASSWORD || adminTestUser.password; - const env = { - kibana: { - server: { - uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', // Kibana UUID for "primary" cluster in monitoring data - } - } - }; - return { // Allow setting any individual component(s) of the URL, // or use default values (username and password from ../kbn/users.js) diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 5e2c3c5a7d062..c490c84bf2142 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -56,6 +56,15 @@ 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 env = { + kibana: { + server: { + uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', // Kibana UUID for "primary" cluster in monitoring data + } + } + }; + + return { // list paths to the files that contain your plugins tests testFiles: [