Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Add context awareness telemetry tests for Observability profiles #201310

Merged
merged 9 commits into from
Nov 29, 2024
1 change: 1 addition & 0 deletions .buildkite/ftr_oblt_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enabled:
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group7.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group8.ts
- x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts
- x-pack/test_serverless/functional/test_suites/observability/config.telemetry.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.apm.serverless.config.ts
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@ x-pack/test_serverless/api_integration/test_suites/common/platform_security @ela
/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples @elastic/kibana-data-discovery
/x-pack/test_serverless/functional/test_suites/common/management/data_views @elastic/kibana-data-discovery
src/plugins/discover/public/context_awareness/profile_providers/security @elastic/kibana-data-discovery @elastic/security-threat-hunting-investigations
src/plugins/discover/public/context_awareness/profile_providers/observability @elastic/kibana-data-discovery @elastic/obs-ux-logs-team

# Platform Docs
/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/index.ts @elastic/platform-docs
Expand Down
6 changes: 4 additions & 2 deletions x-pack/test_serverless/functional/config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import { pageObjects } from './page_objects';
import { services } from './services';
import type { CreateTestConfigOptions } from '../shared/types';

export function createTestConfig(options: CreateTestConfigOptions) {
export function createTestConfig<TServices extends {} = typeof services>(
options: CreateTestConfigOptions<TServices>
) {
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const svlSharedConfig = await readConfigFile(require.resolve('../shared/config.base.ts'));

return {
...svlSharedConfig.getAll(),

pageObjects,
services,
services: { ...services, ...options.services },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good solution, we shouldn't expose those ebt FTR services by default as it probably won't work against MKI

esTestCluster: {
...svlSharedConfig.get('esTestCluster'),
serverArgs: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 type { GenericFtrProviderContext } from '@kbn/test';
import { KibanaEBTUIProvider } from '@kbn/test-suites-src/analytics/services/kibana_ebt';
import { services as inheritedServices } from '../../services';
import { pageObjects } from '../../page_objects';
import { createTestConfig } from '../../config.base';

type ObservabilityTelemetryServices = typeof inheritedServices & {
kibana_ebt_ui: typeof KibanaEBTUIProvider;
};

const services: ObservabilityTelemetryServices = {
...inheritedServices,
kibana_ebt_ui: KibanaEBTUIProvider,
};

export type ObservabilityTelemetryFtrProviderContext = GenericFtrProviderContext<
ObservabilityTelemetryServices,
typeof pageObjects
>;

export default createTestConfig({
serverlessProject: 'oblt',
testFiles: [require.resolve('./index.telemetry.ts')],
junit: {
reportName: 'Serverless Observability Telemetry Functional Tests',
},
suiteTags: { exclude: ['skipSvlOblt'] },
services,

// include settings from project controller
// https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/elasticsearch.yml
esServerArgs: ['xpack.ml.dfa.enabled=false'],
kbnServerArgs: [
`--plugin-path=${resolve(
__dirname,
'../../../../../test/analytics/plugins/analytics_ftr_helpers'
)}`,
],
});
Loading