import path from 'path' ; import fs from 'fs' ; import { FtrConfigProviderContext } from '@kbn/test' ; import { services } from './services' ; export default async function ( { readConfigFile } ) { const integrationConfig = await readConfigFile ( require . resolve ( '../api_integration/config' ) ) ; const allFiles = fs . readdirSync ( path . resolve ( __dirname , 'plugins' ) ) ; const plugins = allFiles . filter ( ( file ) => fs . statSync ( path . resolve ( __dirname , 'plugins' , file ) ) . isDirectory ( ) ) ; return { testFiles : [ require . resolve ( './test_suites/platform' ) , require . resolve ( './test_suites/task_manager' ) , require . resolve ( './test_suites/event_log' ) , require . resolve ( './test_suites/licensed_feature_usage' ) , ] , services , servers : integrationConfig . get ( 'servers' ) , esTestCluster : integrationConfig . get ( 'esTestCluster' ) , apps : integrationConfig . get ( 'apps' ) , screenshots : integrationConfig . get ( 'screenshots' ) , junit : { reportName : 'Plugin Functional Tests' , } , kbnTestServer : { ... integrationConfig . get ( 'kbnTestServer' ) , serverArgs : [ ... integrationConfig . get ( 'kbnTestServer.serverArgs' ) , '--xpack.eventLog.logEntries=true' , '--xpack.eventLog.indexEntries=true' , '--xpack.task_manager.monitored_aggregated_stats_refresh_rate=5000' , '--xpack.task_manager.ephemeral_tasks.enabled=false' , '--xpack.task_manager.ephemeral_tasks.request_capacity=100' , ... plugins . map ( ( pluginDir ) => `--plugin-path=${ path . resolve ( __dirname , 'plugins' , pluginDir ) }` ) , ] , } , } ; }