-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
serverless_config.ts
61 lines (54 loc) · 2.2 KB
/
serverless_config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { getLocalhostRealIp } from '@kbn/security-solution-plugin/scripts/endpoint/common/network_services';
import { FtrConfigProviderContext } from '@kbn/test';
import { ExperimentalFeatures } from '@kbn/security-solution-plugin/common/experimental_features';
import { ES_RESOURCES } from '@kbn/security-solution-plugin/scripts/endpoint/common/roles_users/serverless';
import { DefendWorkflowsCypressCliTestRunner } from './runner';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const defendWorkflowsCypressConfig = await readConfigFile(
require.resolve(
'../../test_serverless/functional/test_suites/security/cypress/security_config.base.ts'
)
);
const config = defendWorkflowsCypressConfig.getAll();
const hostIp = getLocalhostRealIp();
const enabledFeatureFlags: Array<keyof ExperimentalFeatures> = [];
return {
...config,
esTestCluster: {
...config.esTestCluster,
serverArgs: [...config.esTestCluster.serverArgs, 'http.host=0.0.0.0'],
},
esServerlessOptions: {
...(config.esServerlessOptions ?? {}),
resources: Object.values(ES_RESOURCES),
},
servers: {
...config.servers,
fleetserver: {
protocol: 'https',
hostname: hostIp,
port: 8220,
},
},
kbnTestServer: {
...config.kbnTestServer,
serverArgs: [
...config.kbnTestServer.serverArgs,
`--xpack.fleet.agents.fleet_server.hosts=["https://${hostIp}:8220"]`,
`--xpack.fleet.agents.elasticsearch.host=http://${hostIp}:${defendWorkflowsCypressConfig.get(
'servers.elasticsearch.port'
)}`,
// set the packagerTaskInterval to 5s in order to speed up test executions when checking fleet artifacts
'--xpack.securitySolution.packagerTaskInterval=5s',
`--xpack.securitySolution.enableExperimental=${JSON.stringify(enabledFeatureFlags)}`,
],
},
testRunner: DefendWorkflowsCypressCliTestRunner,
};
}