From 4bcb4c6b4fa8529c1aa8be1848b556af98b0801f Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau Date: Tue, 6 Dec 2022 15:09:20 -0500 Subject: [PATCH] [RAM] Bring back API integration (#146930) Bring back API integration --- .buildkite/ftr_configs.yml | 1 + .../group1/tests/alerting/index.ts | 27 +++++++---------- .../security_and_spaces/group3/config.ts | 19 ++++++++++++ .../tests/alerting/bulk_delete.ts | 0 .../tests/alerting/bulk_disable.ts | 0 .../tests/alerting/bulk_edit.ts | 0 .../tests/alerting/bulk_enable.ts | 0 .../tests/alerting/clone.ts | 0 .../group3/tests/alerting/index.ts | 30 +++++++++++++++++++ .../security_and_spaces/group3/tests/index.ts | 15 ++++++++++ 10 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts rename x-pack/test/alerting_api_integration/security_and_spaces/{group1 => group3}/tests/alerting/bulk_delete.ts (100%) rename x-pack/test/alerting_api_integration/security_and_spaces/{group1 => group3}/tests/alerting/bulk_disable.ts (100%) rename x-pack/test/alerting_api_integration/security_and_spaces/{group1 => group3}/tests/alerting/bulk_edit.ts (100%) rename x-pack/test/alerting_api_integration/security_and_spaces/{group1 => group3}/tests/alerting/bulk_enable.ts (100%) rename x-pack/test/alerting_api_integration/security_and_spaces/{group1 => group3}/tests/alerting/clone.ts (100%) create mode 100644 x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/index.ts create mode 100644 x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/index.ts diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index b03abf9a15c67..be16e5f1ee408 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -123,6 +123,7 @@ enabled: - x-pack/test/alerting_api_integration/basic/config.ts - x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts - x-pack/test/alerting_api_integration/security_and_spaces/group2/config.ts + - x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts - x-pack/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts - x-pack/test/alerting_api_integration/spaces_only/config.ts - x-pack/test/api_integration_basic/config.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts index 2f72e9ea41da1..86b249dc6bc79 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/index.ts @@ -20,22 +20,17 @@ export default function alertingTests({ loadTestFile, getService }: FtrProviderC await tearDown(getService); }); - // loadTestFile(require.resolve('./find')); - // loadTestFile(require.resolve('./create')); - // loadTestFile(require.resolve('./delete')); - // loadTestFile(require.resolve('./disable')); - // loadTestFile(require.resolve('./enable')); - // loadTestFile(require.resolve('./execution_status')); - // loadTestFile(require.resolve('./get')); - // loadTestFile(require.resolve('./get_alert_state')); - // loadTestFile(require.resolve('./get_alert_summary')); - // loadTestFile(require.resolve('./rule_types')); - // loadTestFile(require.resolve('./bulk_edit')); - // loadTestFile(require.resolve('./bulk_delete')); - // loadTestFile(require.resolve('./bulk_enable')); - // loadTestFile(require.resolve('./bulk_disable')); - // loadTestFile(require.resolve('./retain_api_key')); - loadTestFile(require.resolve('./clone')); + loadTestFile(require.resolve('./find')); + loadTestFile(require.resolve('./create')); + loadTestFile(require.resolve('./delete')); + loadTestFile(require.resolve('./disable')); + loadTestFile(require.resolve('./enable')); + loadTestFile(require.resolve('./execution_status')); + loadTestFile(require.resolve('./get')); + loadTestFile(require.resolve('./get_alert_state')); + loadTestFile(require.resolve('./get_alert_summary')); + loadTestFile(require.resolve('./rule_types')); + loadTestFile(require.resolve('./retain_api_key')); }); }); } diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts new file mode 100644 index 0000000000000..f999da061b90b --- /dev/null +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts @@ -0,0 +1,19 @@ +/* + * 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 { createTestConfig } from '../../common/config'; + +// eslint-disable-next-line import/no-default-export +export default createTestConfig('security_and_spaces', { + disabledPlugins: [], + license: 'trial', + ssl: true, + enableActionsProxy: true, + publicBaseUrl: true, + testFiles: [require.resolve('./tests')], + useDedicatedTaskRunner: true, +}); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_delete.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_delete.ts similarity index 100% rename from x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_delete.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_delete.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_disable.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_disable.ts similarity index 100% rename from x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_disable.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_disable.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_edit.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts similarity index 100% rename from x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_edit.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_enable.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_enable.ts similarity index 100% rename from x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/bulk_enable.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_enable.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/clone.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts similarity index 100% rename from x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/clone.ts rename to x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/index.ts new file mode 100644 index 0000000000000..0dd1ec2531733 --- /dev/null +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/index.ts @@ -0,0 +1,30 @@ +/* + * 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 { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { setupSpacesAndUsers, tearDown } from '../../../setup'; + +// eslint-disable-next-line import/no-default-export +export default function alertingTests({ loadTestFile, getService }: FtrProviderContext) { + describe('Alerts - Group 3', () => { + describe('alerts', () => { + before(async () => { + await setupSpacesAndUsers(getService); + }); + + after(async () => { + await tearDown(getService); + }); + + loadTestFile(require.resolve('./bulk_edit')); + loadTestFile(require.resolve('./bulk_delete')); + loadTestFile(require.resolve('./bulk_enable')); + loadTestFile(require.resolve('./bulk_disable')); + loadTestFile(require.resolve('./clone')); + }); + }); +} diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/index.ts new file mode 100644 index 0000000000000..c6b0d233a6041 --- /dev/null +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/index.ts @@ -0,0 +1,15 @@ +/* + * 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 { FtrProviderContext } from '../../../../common/ftr_provider_context'; + +// eslint-disable-next-line import/no-default-export +export default function alertingApiIntegrationTests({ loadTestFile }: FtrProviderContext) { + describe('alerting api integration security and spaces enabled - Group 3', function () { + loadTestFile(require.resolve('./alerting')); + }); +}