2020-03-03 17:51:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { resolve } from 'path';
|
|
|
|
import Url from 'url';
|
|
|
|
|
|
|
|
import { withProcRunner } from '@kbn/dev-utils';
|
|
|
|
|
|
|
|
import { FtrProviderContext } from './ftr_provider_context';
|
|
|
|
|
|
|
|
export async function SiemCypressTestRunner({ getService }: FtrProviderContext) {
|
|
|
|
const log = getService('log');
|
|
|
|
const config = getService('config');
|
|
|
|
const esArchiver = getService('esArchiver');
|
|
|
|
|
|
|
|
await esArchiver.load('empty_kibana');
|
|
|
|
await esArchiver.load('auditbeat');
|
|
|
|
|
2020-05-22 09:08:58 +02:00
|
|
|
await withProcRunner(log, async (procs) => {
|
2020-03-03 17:51:35 +01:00
|
|
|
await procs.run('cypress', {
|
|
|
|
cmd: 'yarn',
|
|
|
|
args: ['cypress:run'],
|
2020-06-04 11:35:13 +02:00
|
|
|
cwd: resolve(__dirname, '../../plugins/security_solution'),
|
2020-03-03 17:51:35 +01:00
|
|
|
env: {
|
|
|
|
FORCE_COLOR: '1',
|
|
|
|
CYPRESS_baseUrl: Url.format(config.get('servers.kibana')),
|
2020-03-10 21:03:48 +01:00
|
|
|
CYPRESS_ELASTICSEARCH_URL: Url.format(config.get('servers.elasticsearch')),
|
2020-03-03 17:51:35 +01:00
|
|
|
CYPRESS_ELASTICSEARCH_USERNAME: config.get('servers.elasticsearch.username'),
|
|
|
|
CYPRESS_ELASTICSEARCH_PASSWORD: config.get('servers.elasticsearch.password'),
|
|
|
|
...process.env,
|
|
|
|
},
|
|
|
|
wait: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|