Skip to content

Commit dd59f2b

Browse files
committed
[FTR] Add warning comments to deployment-agnostic FTR base configs (#260018)
This PR adds warning comments and improves error messages in the deployment-agnostic base config files so both humans and agents are guided to create a feature flag config instead of modifying the base config server arguments directly. Learn more about FTR deployment agnostic configs in the dedicated [README](https://github.com/elastic/kibana/blob/main/x-pack/platform/test/api_integration_deployment_agnostic/README.md). (cherry picked from commit c04023f)
1 parent 84b2653 commit dd59f2b

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

x-pack/platform/test/api_integration_deployment_agnostic/default_configs/serverless.config.base.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,27 @@ interface CreateTestConfigOptions<T> {
2424
tier?: 'oblt_logs_essentials';
2525
}
2626

27-
// include settings from elasticsearch controller
27+
// These args replicate the MKI setup from the elasticsearch controller:
2828
// https://github.com/elastic/elasticsearch-controller/blob/main/helm/values.yaml
29+
//
30+
// ⚠️ Tests targeting these configs run against MKI. Adding a server arg here may allow
31+
// tests to pass on Kibana CI but will cause failures on MKI if it is not yet supported there.
32+
// If your test needs a feature flag, create a config under feature_flag_configs/ using
33+
// createServerlessFeatureFlagTestConfig from feature_flag.serverless.config.base.ts.
2934
const esServerArgsFromController = {
3035
es: [],
3136
oblt: ['xpack.apm_data.enabled=true'],
3237
security: ['xpack.security.authc.api_key.cache.max_keys=70000'],
3338
chat: [],
3439
};
3540

36-
// include settings from kibana controller
41+
// These args replicate the MKI setup from the kibana controller:
3742
// https://github.com/elastic/kibana-controller/blob/main/internal/controllers/kibana/config/config_settings.go
43+
//
44+
// ⚠️ Tests targeting these configs run against MKI. Adding a server arg here may allow
45+
// tests to pass on Kibana CI but will cause failures on MKI if it is not yet supported there.
46+
// If your test needs a feature flag, create a config under feature_flag_configs/ using
47+
// createServerlessFeatureFlagTestConfig from feature_flag.serverless.config.base.ts.
3848
const kbnServerArgsFromController = {
3949
es: [
4050
// useful for testing (also enabled in MKI QA)
@@ -59,8 +69,10 @@ export function createServerlessTestConfig<T extends DeploymentAgnosticCommonSer
5969
return async ({ readConfigFile }: FtrConfigProviderContext): Promise<Config> => {
6070
if (options.esServerArgs || options.kbnServerArgs) {
6171
throw new Error(
62-
`FTR doesn't provision custom ES/Kibana server arguments into the serverless project on MKI.
63-
It may lead to unexpected test failures on Cloud. Please contact #appex-qa.`
72+
`Deployment-agnostic configs run unchanged on MKI. Custom ES/Kibana server args passed here
73+
won't be set on MKI and will cause unexpected test failures on Cloud.
74+
If your test needs a feature flag, create a config under feature_flag_configs/ using
75+
createServerlessFeatureFlagTestConfig from feature_flag.serverless.config.base.ts.`
6476
);
6577
}
6678

x-pack/platform/test/api_integration_deployment_agnostic/default_configs/stateful.config.base.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export function createStatefulTestConfig<T extends DeploymentAgnosticCommonServi
4444
return async ({ readConfigFile }: FtrConfigProviderContext) => {
4545
if (options.esServerArgs || options.kbnServerArgs) {
4646
throw new Error(
47-
`FTR doesn't provision custom ES/Kibana server arguments into the ESS deployment.
48-
It may lead to unexpected test failures on Cloud. Please contact #appex-qa.`
47+
`Deployment-agnostic configs run unchanged on ECH (Elastic Cloud). Custom ES/Kibana server args passed here
48+
won't be set on ECH and will cause unexpected test failures.
49+
If your test needs a feature flag, create a config under feature_flag_configs/ using
50+
createStatefulFeatureFlagTestConfig from feature_flag.stateful.config.base.ts.`
4951
);
5052
}
5153

@@ -94,6 +96,8 @@ export function createStatefulTestConfig<T extends DeploymentAgnosticCommonServi
9496
exclude: [...(options.suiteTags?.exclude || []), 'skipStateful'],
9597
},
9698

99+
// ⚠️ Do not add server args here to make tests pass as they won't be set on ECH (Elastic Cloud Hosted).
100+
// If your test needs a feature flag, use createStatefulFeatureFlagTestConfig (feature_flag_configs/).
97101
esTestCluster: {
98102
...xPackAPITestsConfig.get('esTestCluster'),
99103
serverArgs: [
@@ -116,6 +120,8 @@ export function createStatefulTestConfig<T extends DeploymentAgnosticCommonServi
116120
path.resolve(REPO_ROOT, STATEFUL_ROLES_ROOT_PATH, 'roles.yml'),
117121
],
118122
},
123+
// ⚠️ Do not add server args here to make tests pass as they won't be set on ECH (Elastic Cloud Hosted).
124+
// If your test needs a feature flag, use createStatefulFeatureFlagTestConfig (feature_flag_configs/).
119125
kbnTestServer: {
120126
...xPackAPITestsConfig.get('kbnTestServer'),
121127
serverArgs: [

0 commit comments

Comments
 (0)