/* * 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 { FtrConfigProviderContext } from '@kbn/test'; import { services } from './services'; import type { CreateTestConfigOptions } from '../shared/types'; export function createTestConfig(options: CreateTestConfigOptions) { return async ({ readConfigFile }: FtrConfigProviderContext) => { const svlSharedConfig = await readConfigFile(require.resolve('../shared/config.base.ts')); return { ...svlSharedConfig.getAll(), services: { ...services, ...options.services, }, kbnTestServer: { ...svlSharedConfig.get('kbnTestServer'), serverArgs: [ ...svlSharedConfig.get('kbnTestServer.serverArgs'), `--serverless=${options.serverlessProject}`, ...(options.kbnServerArgs || []), ], }, testFiles: options.testFiles, junit: options.junit, suiteTags: options.suiteTags, }; }; }