Skip to content

Commit

Permalink
[Discover] Add context awareness telemetry tests for Observability pr…
Browse files Browse the repository at this point in the history
…ofiles (elastic#201310)

## Summary

As suggested in
elastic#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)
  • Loading branch information
davismcphee committed Nov 29, 2024
1 parent 2a4c944 commit 68dbf57
Show file tree
Hide file tree
Showing 8 changed files with 452 additions and 4 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_oblt_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ disabled:
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.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
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,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 },
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

0 comments on commit 68dbf57

Please sign in to comment.