Skip to content

Commit

Permalink
move alerting and slo apis under deployment agnostic services
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed May 27, 2024
1 parent 00ae289 commit 4d21820
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
import { MetricThresholdParams } from '@kbn/infra-plugin/common/alerting/metrics';
import { ThresholdParams } from '@kbn/observability-plugin/common/custom_threshold_rule/types';
import { SloBurnRateRuleParams } from './slo_api';
import { FtrProviderContext } from '../../functional/ftr_provider_context';
import { FtrProviderContext } from '../ftr_provider_context';

export function AlertingApiProvider({ getService }: FtrProviderContext) {
const retry = getService('retry');
Expand Down
4 changes: 4 additions & 0 deletions x-pack/test/api_integration/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { IngestPipelinesProvider } from './ingest_pipelines';
import { IndexManagementProvider } from './index_management';
import { DataViewApiProvider } from './data_view_api';
import { SloApiProvider } from './slo';
import { SloApiProvider as SloApiProviderNew } from './slo_api';
import { AlertingApiProvider } from './alerting_api';
import { SecuritySolutionApiProvider } from './security_solution_api.gen';

export const services = {
Expand All @@ -45,4 +47,6 @@ export const services = {
indexManagement: IndexManagementProvider,
slo: SloApiProvider,
securitySolutionApi: SecuritySolutionApiProvider,
alertingApi: AlertingApiProvider,
sloApi: SloApiProviderNew, // TODO: Need to unify SloApiProvider and SloApiProviderNew, there was already an slo service here, part of the slo API migration issue https://github.com/elastic/kibana/issues/183397
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,11 @@ export function createTestConfig(options: CreateTestConfigOptions) {
require.resolve('../../../api_integration/config.ts')
);

const svlSharedConfig = await readConfigFile(
require.resolve('../../../../test_serverless/shared/config.base.ts')
);
const svlSharedServices = svlSharedConfig.get('services');

return {
...xPackApiIntegrationTestsConfig.getAll(),
testFiles: options.testFiles,
services: {
...services,
sloApi: svlSharedServices.sloApi,
alertingApi: svlSharedServices.alertingApi,
},
junit: {
reportName: 'X-Pack Οbservability Solution API Integration Tests',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const deploymentAgnosticApiIntegrationServices = _.pick(apiIntegrationServices,
'usageAPI',
'console',
'securitySolutionApi',
'alertingApi',
'sloApi',
]);

export const services = {
Expand Down
4 changes: 0 additions & 4 deletions x-pack/test_serverless/shared/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { SvlCommonApiServiceProvider } from './svl_common_api';
import { SvlReportingServiceProvider } from './svl_reporting';
import { SvlUserManagerProvider } from './svl_user_manager';
import { DataViewApiProvider } from './data_view_api';
import { AlertingApiProvider } from './alerting_api';
import { SloApiProvider } from './slo_api';
export type { RoleCredentials } from './svl_user_manager';
export type { InternalRequestHeader } from './svl_common_api';
export type { SupertestWithoutAuthType } from './supertest';
Expand All @@ -23,6 +21,4 @@ export const services = {
svlReportingApi: SvlReportingServiceProvider,
svlUserManager: SvlUserManagerProvider,
dataViewApi: DataViewApiProvider,
alertingApi: AlertingApiProvider,
sloApi: SloApiProvider,
};

0 comments on commit 4d21820

Please sign in to comment.