Skip to content

Commit

Permalink
Scope services to just compatible telemetry config
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed Nov 26, 2024
1 parent 67a5954 commit 38b9306
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
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
7 changes: 0 additions & 7 deletions x-pack/test_serverless/functional/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* 2.0.
*/

import {
KibanaEBTUIProvider,
KibanaEBTServerProvider,
} from '@kbn/test-suites-src/analytics/services/kibana_ebt';
import { services as deploymentAgnosticFunctionalServices } from './deployment_agnostic_services';
import { services as svlSharedServices } from '../../shared/services';
import { SvlCommonNavigationServiceProvider } from './svl_common_navigation';
Expand Down Expand Up @@ -39,7 +35,4 @@ export const services = {
// log services
svlLogsSynthtraceClient: LogsSynthtraceProvider,
alertingApi: SvlApiIntegrationSvcs.alertingApi,
// EBT services
kibana_ebt_server: KibanaEBTServerProvider,
kibana_ebt_ui: KibanaEBTUIProvider,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,39 @@
*/

import { resolve } from 'path';
import type { GenericFtrProviderContext } from '@kbn/test';
import {
KibanaEBTUIProvider,
KibanaEBTServerProvider,
} 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_server: typeof KibanaEBTServerProvider;
kibana_ebt_ui: typeof KibanaEBTUIProvider;
};

const services: ObservabilityTelemetryServices = {
...inheritedServices,
kibana_ebt_server: KibanaEBTServerProvider,
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import expect from '@kbn/expect';
import type { FtrProviderContext } from '../../../../../ftr_provider_context';
import type { ObservabilityTelemetryFtrProviderContext } from '../../../config.telemetry';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
export default function ({ getService, getPageObjects }: ObservabilityTelemetryFtrProviderContext) {
const { common, discover, unifiedFieldList, dashboard, header, timePicker, svlCommonPage } =
getPageObjects([
'common',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
* 2.0.
*/

import type { FtrProviderContext } from '../../../../../ftr_provider_context';
import type { ObservabilityTelemetryFtrProviderContext } from '../../../config.telemetry';

export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) {
export default function ({
getService,
getPageObjects,
loadTestFile,
}: ObservabilityTelemetryFtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['timePicker', 'svlCommonPage']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 2.0.
*/

import { FtrProviderContext } from '../../ftr_provider_context';
import type { ObservabilityTelemetryFtrProviderContext } from './config.telemetry';

export default function ({ loadTestFile }: FtrProviderContext) {
export default function ({ loadTestFile }: ObservabilityTelemetryFtrProviderContext) {
describe('serverless observability UI - telemetry', function () {
this.tags(['skipMKI', 'esGate']);

Expand Down
4 changes: 2 additions & 2 deletions x-pack/test_serverless/shared/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import { ServerlessProjectType } from '@kbn/es';
import { InheritedServices } from '../../api_integration/services';

export interface CreateTestConfigOptions {
export interface CreateTestConfigOptions<TServices extends {} = InheritedServices> {
serverlessProject: ServerlessProjectType;
esServerArgs?: string[];
kbnServerArgs?: string[];
testFiles: string[];
junit: { reportName: string };
suiteTags?: { include?: string[]; exclude?: string[] };
services?: InheritedServices;
services?: TServices;
apps?: Record<string, { pathname: string; hash?: string }>;
}

0 comments on commit 38b9306

Please sign in to comment.