Skip to content

Commit

Permalink
[6.4] x-pack tests should use servers from other config files already…
Browse files Browse the repository at this point in the history
… loaded (#22739) (#22764)

* merge to 6.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',

* Add env object back in.

* Move env from es_test_config to x-pack/test/functional/config
  • Loading branch information
Lee Drengenberg authored Sep 12, 2018
1 parent db74ea2 commit c3031c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
5 changes: 3 additions & 2 deletions packages/kbn-test/src/es/es_test_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 2 additions & 23 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/* eslint-disable kibana-custom/no-default-export */

import { resolve } from 'path';
import { format as formatUrl } from 'url';

import {
SecurityPageProvider,
Expand Down Expand Up @@ -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',
},
};

const env = {
kibana: {
server: {
Expand All @@ -84,6 +64,7 @@ export default async function ({ readConfigFile }) {
}
};


return {
// list paths to the files that contain your plugins tests
testFiles: [
Expand Down Expand Up @@ -143,7 +124,7 @@ export default async function ({ readConfigFile }) {
reporting: ReportingPageProvider,
},

servers,
servers: kibanaFunctionalConfig.get('servers'),

env,

Expand All @@ -161,8 +142,6 @@ export default async function ({ readConfigFile }) {
serverArgs: [
...kibanaCommonConfig.get('kbnTestServer.serverArgs'),
`--server.uuid=${env.kibana.server.uuid}`,
`--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
],
Expand Down

0 comments on commit c3031c9

Please sign in to comment.