mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
## Summary This PR adds a test config category to the scout reporting. This allows us to distinguish between UI and API FTR tests. A new property `testConfigCategory` has been added to all FTR configs that don't already inherit it from a higher level config.
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
/*
|
|
* 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 { ScoutTestRunConfigCategory } from '@kbn/scout-info';
|
|
|
|
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(),
|
|
|
|
testConfigCategory: ScoutTestRunConfigCategory.API_TEST,
|
|
services: {
|
|
...services,
|
|
...options.services,
|
|
},
|
|
esTestCluster: {
|
|
...svlSharedConfig.get('esTestCluster'),
|
|
serverArgs: [
|
|
...svlSharedConfig.get('esTestCluster.serverArgs'),
|
|
// custom native roles are enabled only for search and security projects
|
|
...(options.serverlessProject !== 'oblt'
|
|
? ['xpack.security.authc.native_roles.enabled=true']
|
|
: []),
|
|
...(options.esServerArgs ?? []),
|
|
],
|
|
},
|
|
kbnTestServer: {
|
|
...svlSharedConfig.get('kbnTestServer'),
|
|
serverArgs: [
|
|
...svlSharedConfig.get('kbnTestServer.serverArgs'),
|
|
`--serverless=${options.serverlessProject}`,
|
|
...(options.kbnServerArgs || []),
|
|
],
|
|
},
|
|
testFiles: options.testFiles,
|
|
junit: options.junit,
|
|
suiteTags: options.suiteTags,
|
|
};
|
|
};
|
|
}
|