Skip to content

Commit

Permalink
[FTR] Merge Alerting Apis from x-pack/test_serverless/shared into `…
Browse files Browse the repository at this point in the history
…x-pack/test/api_integration/deployment_agnostic` (#193975)

## Summary

Follow up of [this pr](#192216),
per [this
discussion](#192216 (comment)).

Also, switch from `svlCommonApi` to `samlAuth` for internal headers.

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Dzmitry Lemechko <[email protected]>
3 people authored Sep 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent abffb37 commit 10c3373
Showing 11 changed files with 910 additions and 1,085 deletions.
Original file line number Diff line number Diff line change
@@ -306,7 +306,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(ruleId, adminRoleAuthc);
const match = await alertingApi.findInRules(adminRoleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be(expectedConsumer);
});

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -170,7 +170,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ export default function ({ getService }: FtrProviderContext) {
});

it('should find the created rule with correct information about the consumer', async () => {
const match = await alertingApi.findRule(roleAuthc, ruleId);
const match = await alertingApi.findInRules(roleAuthc, ruleId);
expect(match).not.to.be(undefined);
expect(match.consumer).to.be('observability');
});
1,072 changes: 0 additions & 1,072 deletions x-pack/test_serverless/shared/services/alerting_api.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
import _ from 'lodash';

import { services as apiIntegrationServices } from '@kbn/test-suites-xpack/api_integration/services';
import { AlertingApiProvider } from './alerting_api';
import { services as apiIntegrationDeploymentAgnosticServices } from '@kbn/test-suites-xpack/api_integration/deployment_agnostic/services';
/*
* Some FTR services from api integration stateful tests are compatible with serverless environment
* While adding a new one, make sure to verify that it works on both Kibana CI and MKI
*/
const deploymentAgnosticApiIntegrationServices = _.pick(apiIntegrationServices, [
const pickedServices = _.pick(apiIntegrationServices, [
'deployment',
'es',
'esArchiver',
@@ -34,6 +34,6 @@ const deploymentAgnosticApiIntegrationServices = _.pick(apiIntegrationServices,

export const services = {
// deployment agnostic FTR services
...deploymentAgnosticApiIntegrationServices,
alertingApi: AlertingApiProvider,
...pickedServices,
alertingApi: apiIntegrationDeploymentAgnosticServices.alertingApi,
};

0 comments on commit 10c3373

Please sign in to comment.