Skip to content

Commit 68dbf57

Browse files
committed
[Discover] Add context awareness telemetry tests for Observability profiles (#201310)
## Summary As suggested in #199255 (comment), I've copied and modified the existing Discover context awareness telemetry tests to work for Observability profiles. This helps test that solution root profiles are picked up as expected, as well as giving us some serverless coverage. @elastic/appex-qa It didn't seem like there were any config specific services for serverless tests yet, so I added the EBT to services to the main serverless config. If there's a better way to do this, please let me know and I can update it. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit be7d748)
1 parent 2a4c944 commit 68dbf57

8 files changed

Lines changed: 452 additions & 4 deletions

File tree

.buildkite/ftr_oblt_serverless_configs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ disabled:
2222
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
2323
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts
2424
- x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts
25+
- x-pack/test_serverless/functional/test_suites/observability/config.telemetry.ts
2526
# serverless config files that run deployment-agnostic tests
2627
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
2728
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.apm.serverless.config.ts

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@ x-pack/test_serverless/api_integration/test_suites/common/platform_security @ela
10901090
/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples @elastic/kibana-data-discovery
10911091
/x-pack/test_serverless/functional/test_suites/common/management/data_views @elastic/kibana-data-discovery
10921092
src/plugins/discover/public/context_awareness/profile_providers/security @elastic/kibana-data-discovery @elastic/security-threat-hunting-investigations
1093+
src/plugins/discover/public/context_awareness/profile_providers/observability @elastic/kibana-data-discovery @elastic/obs-ux-logs-team
10931094

10941095
# Platform Docs
10951096
/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/index.ts @elastic/platform-docs

x-pack/test_serverless/functional/config.base.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ import { pageObjects } from './page_objects';
1111
import { services } from './services';
1212
import type { CreateTestConfigOptions } from '../shared/types';
1313

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

1820
return {
1921
...svlSharedConfig.getAll(),
2022

2123
pageObjects,
22-
services,
24+
services: { ...services, ...options.services },
2325
esTestCluster: {
2426
...svlSharedConfig.get('esTestCluster'),
2527
serverArgs: [
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import { resolve } from 'path';
9+
import type { GenericFtrProviderContext } from '@kbn/test';
10+
import { KibanaEBTUIProvider } from '@kbn/test-suites-src/analytics/services/kibana_ebt';
11+
import { services as inheritedServices } from '../../services';
12+
import { pageObjects } from '../../page_objects';
13+
import { createTestConfig } from '../../config.base';
14+
15+
type ObservabilityTelemetryServices = typeof inheritedServices & {
16+
kibana_ebt_ui: typeof KibanaEBTUIProvider;
17+
};
18+
19+
const services: ObservabilityTelemetryServices = {
20+
...inheritedServices,
21+
kibana_ebt_ui: KibanaEBTUIProvider,
22+
};
23+
24+
export type ObservabilityTelemetryFtrProviderContext = GenericFtrProviderContext<
25+
ObservabilityTelemetryServices,
26+
typeof pageObjects
27+
>;
28+
29+
export default createTestConfig({
30+
serverlessProject: 'oblt',
31+
testFiles: [require.resolve('./index.telemetry.ts')],
32+
junit: {
33+
reportName: 'Serverless Observability Telemetry Functional Tests',
34+
},
35+
suiteTags: { exclude: ['skipSvlOblt'] },
36+
services,
37+
38+
// include settings from project controller
39+
// https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/elasticsearch.yml
40+
esServerArgs: ['xpack.ml.dfa.enabled=false'],
41+
kbnServerArgs: [
42+
`--plugin-path=${resolve(
43+
__dirname,
44+
'../../../../../test/analytics/plugins/analytics_ftr_helpers'
45+
)}`,
46+
],
47+
});

0 commit comments

Comments
 (0)