Skip to content

Commit

Permalink
refactor reading services from test_serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed May 14, 2024
1 parent 0917e44 commit b8237fc
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 369 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,29 @@
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from '../../../api_integration/services';

export function createTestConfig(options) {
export interface CreateTestConfigOptions {
testFiles: string[];
junit: { reportName: string };
}

export function createTestConfig(options: CreateTestConfigOptions) {
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const xPackApiIntegrationTestsConfig = await readConfigFile(
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,
...options.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 @@ -23,7 +23,6 @@ export function createTestConfig(options: CreateTestConfigOptions) {
...svlSharedConfig.getAll(),
services: {
...services,
...options.services,
},
kbnTestServer: {
...svlSharedConfig.get('kbnTestServer'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
*/

import { createTestConfig } from '../../../../config/ess/config.base';
import { AlertingApiProvider } from '../../../../services/alerting_api';
import { SloApiProvider } from '../../../../services/slo_api';

export default createTestConfig({
services: {
alertingApi: AlertingApiProvider,
sloApi: SloApiProvider,
},
testFiles: [require.resolve('..')],
junit: {
reportName: 'SLO - Burn rate Integration Tests - ESS Env',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
*/

import { createTestConfig } from '../../../../config/serverless/config.base';
import { AlertingApiProvider } from '../../../../services/alerting_api';
import { SloApiProvider } from '../../../../services/slo_api';

export default createTestConfig({
services: {
alertingApi: AlertingApiProvider,
sloApi: SloApiProvider,
},
testFiles: [require.resolve('..')],
junit: {
reportName: 'SLO - Integration Tests - Serverless Env',
Expand Down
162 changes: 0 additions & 162 deletions x-pack/test_serverless/api_integration/services/alerting_api.ts

This file was deleted.

5 changes: 0 additions & 5 deletions x-pack/test_serverless/api_integration/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
import { GenericFtrProviderContext } from '@kbn/test';
import { services as deploymentAgnosticSharedServices } from '../../shared/services/deployment_agnostic_services';
import { services as svlSharedServices } from '../../shared/services';

import { AlertingApiProvider } from './alerting_api';
import { SamlToolsProvider } from './saml_tools';
import { SvlCasesServiceProvider } from './svl_cases';
import { SloApiProvider } from './slo_api';
import { TransformProvider } from './transform';

export const services = {
Expand All @@ -21,10 +18,8 @@ export const services = {

// serverless FTR services
...svlSharedServices,
alertingApi: AlertingApiProvider,
samlTools: SamlToolsProvider,
svlCases: SvlCasesServiceProvider,
sloApi: SloApiProvider,
transform: TransformProvider,
};

Expand Down
Loading

0 comments on commit b8237fc

Please sign in to comment.