kibana/x-pack/test/api_integration/config.ts
Dzmitry Lemechko 745e9ad9d7
[ftr] split x-pack api integration tests based on plugin (#150837)
## Summary

Currently we run all x-pack api integration tests as a single piece
(config) and it takes on average **33+ minutes**
If a single test fails, buildkite retries the config and you have to
wait another 30+ minutes to see if test passed (flaky test sign) or
failed (PR broke test)

<img width="1581" alt="image"
src="https://user-images.githubusercontent.com/10977896/218059268-1d4b5b40-797d-4748-a9f6-9101cfd9803a.png">


Splitting config into many small ones will not only speedup overall CI
run (configs will be assigned to different workers based on its
historical run time) but also speedup retry by running only a sub set of
tests related to the particular config file.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-13 15:06:11 +00:00

50 lines
1.9 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 { services } from './services';
export async function getApiIntegrationConfig({ readConfigFile }: FtrConfigProviderContext) {
const xPackFunctionalTestsConfig = await readConfigFile(
require.resolve('../functional/config.base.js')
);
return {
services,
servers: xPackFunctionalTestsConfig.get('servers'),
security: xPackFunctionalTestsConfig.get('security'),
junit: {
reportName: 'X-Pack API Integration Tests',
},
kbnTestServer: {
...xPackFunctionalTestsConfig.get('kbnTestServer'),
serverArgs: [
...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'),
'--xpack.security.session.idleTimeout=3600000', // 1 hour
'--telemetry.optIn=true',
'--xpack.fleet.agents.pollingRequestTimeout=5000', // 5 seconds
'--xpack.ruleRegistry.write.enabled=true',
'--xpack.ruleRegistry.write.enabled=true',
'--xpack.ruleRegistry.write.cache.enabled=false',
'--xpack.uptime.service.password=test',
'--xpack.uptime.service.username=localKibanaIntegrationTestsUser',
'--xpack.uptime.service.devUrl=mockDevUrl',
'--monitoring_collection.opentelemetry.metrics.prometheus.enabled=true',
],
},
esTestCluster: {
...xPackFunctionalTestsConfig.get('esTestCluster'),
serverArgs: [
...xPackFunctionalTestsConfig.get('esTestCluster.serverArgs'),
'node.attr.name=apiIntegrationTestNode',
'path.repo=/tmp/repo,/tmp/repo_1,/tmp/repo_2,/tmp/cloud-snapshots/',
],
},
};
}
export default getApiIntegrationConfig;