import { resolve } from 'path' ; import fs from 'fs' ; import { FtrConfigProviderContext } from '@kbn/test' ; import { services } from './services' ; import { pageObjects } from './page_objects' ; export default async function ( { readConfigFile } ) { const xpackFunctionalConfig = await readConfigFile ( require . resolve ( '../functional/config.js' ) ) ; const allFiles = fs . readdirSync ( resolve ( __dirname , 'plugins' ) ) ; const plugins = allFiles . filter ( ( file ) => fs . statSync ( resolve ( __dirname , 'plugins' , file ) ) . isDirectory ( ) ) ; return { ... xpackFunctionalConfig . getAll ( ) , testFiles : [ resolve ( __dirname , './test_suites/application_usage' ) , resolve ( __dirname , './test_suites/stack_management_usage' ) , ] , services , pageObjects , kbnTestServer : { ... xpackFunctionalConfig . get ( 'kbnTestServer' ) , serverArgs : [ ... xpackFunctionalConfig . get ( 'kbnTestServer.serverArgs' ) , ... plugins . map ( ( pluginDir ) => `--plugin-path=${ resolve ( __dirname , 'plugins' , pluginDir ) }` ) , ] , } , junit : { reportName : 'X-Pack Usage Collection Functional Tests' , } , } ; }