import { readFileSync } from 'fs' ; import { resolve , join } from 'path' ; import { CA_CERT_PATH } from '@kbn/dev-utils' ; import { FtrConfigProviderContext } from '@kbn/test' ; const enabledActionTypes = [ '.email' , '.index' , '.pagerduty' , '.swimlane' , '.servicenow' , '.slack' , '.webhook' , 'test.authorization' , 'test.failing' , 'test.index-record' , 'test.noop' , 'test.rate-limit' , ] ; export default async function ( { readConfigFile } ) { const xpackFunctionalConfig = await readConfigFile ( require . resolve ( '../functional/config.js' ) ) ; const servers = { ... xpackFunctionalConfig . get ( 'servers' ) , elasticsearch : { ... xpackFunctionalConfig . get ( 'servers.elasticsearch' ) , protocol : 'https' , certificateAuthorities : [ readFileSync ( CA_CERT_PATH ) ] , } , } ; return { ... xpackFunctionalConfig . getAll ( ) , servers , esTestCluster : { ... xpackFunctionalConfig . get ( 'esTestCluster' ) , ssl : true , } , kbnTestServer : { ... xpackFunctionalConfig . get ( 'kbnTestServer' ) , serverArgs : [ ... xpackFunctionalConfig . get ( 'kbnTestServer.serverArgs' ) , `--elasticsearch.hosts=https://${ servers . elasticsearch . hostname }:${ servers . elasticsearch . port }` , `--elasticsearch.ssl.certificateAuthorities=${ CA_CERT_PATH }` , `--plugin-path=${ join ( __dirname , '..' , 'functional_with_es_ssl' , 'fixtures' , 'plugins' , 'alerts' ) }` , `--xpack.actions.enabledActionTypes=${ JSON . stringify ( enabledActionTypes ) }` , `--xpack.actions.preconfiguredAlertHistoryEsIndex=false` , `--xpack.actions.preconfigured=${ JSON . stringify ( { 'my-slack1' : { actionTypeId : '.slack' , name : 'Slack#xyztest' , secrets : { webhookUrl : 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz' , } , } , 'my-server-log' : { actionTypeId : '.server-log' , name : 'Serverlog#xyz' , } , 'my-email-connector' : { actionTypeId : '.email' , name : 'Email#test-preconfigured-email' , config : { from : 'me@example.com' , host : 'localhost' , port : '1025' , } , } , } ) }` , ] , } , uiSettings : { defaults : { 'dateFormat:tz' : 'UTC' , } , } , testFiles : [ resolve ( __dirname , './apps/observability' ) ] , junit : { ... xpackFunctionalConfig . get ( 'junit' ) , reportName : 'Chrome X-Pack Observability UI Functional Tests' , } , } ; }