fix xpack integration tests, add to CI (#30883) (#31152)

* fix xpack integration tests, add to CI

* faster tests, intigration runs in paralel

* fix intigration test

* revert hard-coding test env to node
This commit is contained in:
Matt Apperson 2019-02-14 16:35:07 -05:00 committed by GitHub
parent f94442caba
commit 33c85491d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

View file

@ -223,7 +223,7 @@ export async function startTestServers({
// Override provided configs, we know what the elastic user is now
kbnSettings.elasticsearch = {
url: esTestConfig.getUrl(),
hosts: [esTestConfig.getUrl()],
username: esTestConfig.getUrlParts().username,
password: esTestConfig.getUrlParts().password,
};

View file

@ -29,3 +29,9 @@ cd "$XPACK_DIR"
node scripts/jest --ci --no-cache --verbose
echo ""
echo ""
echo " -> Running jest integration tests"
cd "$XPACK_DIR"
node scripts/jest_integration --ci --no-cache --verbose
echo ""
echo ""

View file

@ -9,7 +9,8 @@ import { camelCase } from 'lodash';
// @ts-ignore
import * as kbnTestServer from '../../../../../../../../src/test_utils/kbn_server';
// @ts-ignore
import { xpackKbnServerConfig } from '../../../../../../../test_utils/kbn_server_config';
import { TestKbnServerConfig } from '../../../../../../../test_utils/kbn_server_config';
import { CONFIG_PREFIX } from '../../../../../common/constants/plugin';
import { PLUGIN } from './../../../../../common/constants/plugin';
import { KibanaBackendFrameworkAdapter } from './../kibana_framework_adapter';
import { contractTests } from './test_contract';
@ -19,13 +20,17 @@ contractTests('Kibana Framework Adapter', {
async before() {
servers = await kbnTestServer.startTestServers({
adjustTimeout: (t: number) => jest.setTimeout(t),
settings: xpackKbnServerConfig,
settings: TestKbnServerConfig,
});
},
async after() {
await servers.stop();
},
adapterSetup: () => {
return new KibanaBackendFrameworkAdapter(camelCase(PLUGIN.ID), servers.kbnServer.server);
return new KibanaBackendFrameworkAdapter(
camelCase(PLUGIN.ID),
servers.kbnServer.server,
CONFIG_PREFIX
);
},
});

View file

@ -18,6 +18,7 @@
const resolve = require('path').resolve;
process.argv.push('--config', resolve(__dirname, '../test_utils/jest/config.integration.js'));
process.argv.push('--runInBand');
require('../../src/setup_node_env');
require('../../src/dev/jest/cli');