kibana/x-pack/test_serverless/functional/config.base.ts
Robert Oskamp cb48dd2d8e
[FTR] Add serverless ES project controller settings (#167299)
## Summary

This PR adds the project controller settings for serverless
Elasticsearch to the Kibana serverless FTR configs. This gets our local
setup closer to what we have in MKI.


### Details

Project controller settings for ES per project:
*
[Observability](https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/elasticsearch.yml)
*
[Search](https://github.com/elastic/project-controller/blob/main/internal/project/esproject/config/elasticsearch.yml)
*
[Security](https://github.com/elastic/project-controller/blob/main/internal/project/security/config/elasticsearch.yml)
2023-09-29 12:12:46 +02:00

90 lines
2.6 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 { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import { pageObjects } from './page_objects';
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(),
pageObjects,
services,
esTestCluster: {
...svlSharedConfig.get('esTestCluster'),
serverArgs: [
...svlSharedConfig.get('esTestCluster.serverArgs'),
...(options.esServerArgs ?? []),
],
},
kbnTestServer: {
...svlSharedConfig.get('kbnTestServer'),
serverArgs: [
...svlSharedConfig.get('kbnTestServer.serverArgs'),
`--serverless=${options.serverlessProject}`,
...(options.kbnServerArgs ?? []),
],
},
testFiles: options.testFiles,
uiSettings: {
defaults: {
'accessibility:disableAnimations': true,
'dateFormat:tz': 'UTC',
},
},
// the apps section defines the urls that
// `PageObjects.common.navigateTo(appKey)` will use.
// Merge urls for your plugin with the urls defined in
// Kibana's config in order to use this helper
apps: {
home: {
pathname: '/app/home',
hash: '/',
},
landingPage: {
pathname: '/',
},
observability: {
pathname: '/app/observability',
},
observabilityLogExplorer: {
pathname: '/app/observability-log-explorer',
},
management: {
pathname: '/app/management',
},
indexManagement: {
pathname: '/app/management/data/index_management',
},
connectors: {
pathname: '/app/management/insightsAndAlerting/triggersActionsConnectors/',
},
advancedSettings: {
pathname: '/app/management/kibana/settings',
},
login: {
pathname: '/login',
},
},
// choose where screenshots should be saved
screenshots: {
directory: resolve(__dirname, 'screenshots'),
},
junit: options.junit,
suiteTags: options.suiteTags,
};
};
}