move code shared with alerting api-integration plugins into a package (#148846)

We're working on converting all plugins into packages, which turns
almost all code in the repository into a package except for things like
the `test` and `x-pack/test` directories. The problem we ran into is
that the alerting api-integration test plugins are being migrated to
packages but they are currently consuming a handful of helpers from the
parent `../lib` directory. This doesn't work, as packages can only
import other packages and the `../lib` directory isn't in a package,
it's just free-floating `x-pack/test` code. To fix this I've moved the
necessary components out of `common/lib` and into `packages/helpers`
which is importable via `@kbn/alerting-api-integration-helpers` and
updated all the uses to access this new package.
This commit is contained in:
Spencer 2023-01-12 15:32:28 -06:00 committed by GitHub
parent 4da8f56354
commit 1880e8b348
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 139 additions and 147 deletions

1
.github/CODEOWNERS vendored
View file

@ -1086,3 +1086,4 @@ x-pack/packages/ml/nested_property @elastic/ml-ui
x-pack/packages/ml/query_utils @elastic/ml-ui
x-pack/packages/ml/string_hash @elastic/ml-ui
x-pack/packages/ml/url_state @elastic/ml-ui
x-pack/test/alerting_api_integration/packages/helpers @elastic/response-ops

View file

@ -748,6 +748,7 @@
"@jest/reporters": "^29.3.1",
"@jest/transform": "^29.3.1",
"@jest/types": "^29.3.1",
"@kbn/alerting-api-integration-helpers": "link:x-pack/test/alerting_api_integration/packages/helpers",
"@kbn/ambient-common-types": "link:packages/kbn-ambient-common-types",
"@kbn/ambient-ftr-types": "link:packages/kbn-ambient-ftr-types",
"@kbn/ambient-storybook-types": "link:packages/kbn-ambient-storybook-types",

View file

@ -16,6 +16,8 @@
"@kbn/aiops-plugin/*": ["x-pack/plugins/aiops/*"],
"@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"],
"@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"],
"@kbn/alerting-api-integration-helpers": ["x-pack/test/alerting_api_integration/packages/helpers"],
"@kbn/alerting-api-integration-helpers/*": ["x-pack/test/alerting_api_integration/packages/helpers/*"],
"@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"],
"@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"],
"@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/plugins/alerts"],

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Space, User } from '../types';
import { ObjectRemover } from './object_remover';
import { getUrlPrefix } from './space_test_utils';
import { ES_TEST_INDEX_NAME } from './es_test_index_tool';
import { getTestRuleData } from './get_test_rule_data';
export interface AlertUtilsOpts {

View file

@ -7,7 +7,6 @@
export { ObjectRemover } from './object_remover';
export { getUrlPrefix } from './space_test_utils';
export { ES_TEST_INDEX_NAME, ESTestIndexTool } from './es_test_index_tool';
export { getTestRuleData } from './get_test_rule_data';
export {
AlertUtils,

View file

@ -8,7 +8,7 @@
import getPort from 'get-port';
import http from 'http';
import httpProxy from 'http-proxy';
import { getProxyPort } from '../../../lib/get_proxy_server';
import { getProxyPort } from '@kbn/alerting-api-integration-helpers';
import { getDataFromRequest } from './data_handler';
export interface ProxyArgs {

View file

@ -18,8 +18,8 @@ import {
RuleTypeParams,
} from '@kbn/alerting-plugin/server';
import { AlertConsumers } from '@kbn/rule-data-utils';
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { FixtureStartDeps, FixtureSetupDeps } from './plugin';
import { ES_TEST_INDEX_NAME } from '../../../lib';
export const EscapableStrings = {
escapableBold: '*bold*',

View file

@ -0,0 +1,3 @@
# @kbn/alerting-api-integration-helpers
A package to hold alerting api-integration test helpers that are shared with the the alerting api-integration plugins.

View file

@ -5,6 +5,7 @@
* 2.0.
*/
import type { Client } from '@elastic/elasticsearch';
export const ES_TEST_INDEX_NAME = '.kibana-alerting-test-data';
export class ESTestIndexTool {

View file

@ -0,0 +1,9 @@
/*
* 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.
*/
export * from './es_test_index_tool';
export * from './get_proxy_server';

View file

@ -0,0 +1,12 @@
/*
* 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.
*/
module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/test/alerting_api_integration/packages/helpers'],
};

View file

@ -0,0 +1,6 @@
{
"type": "test-helper",
"id": "@kbn/alerting-api-integration-helpers",
"owner": "@elastic/response-ops",
"devOnly": true
}

View file

@ -0,0 +1,6 @@
{
"name": "@kbn/alerting-api-integration-helpers",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}

View file

@ -8,7 +8,7 @@
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {

View file

@ -8,7 +8,7 @@
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {

View file

@ -10,8 +10,8 @@ import expect from '@kbn/expect';
import { promisify } from 'util';
import httpProxy from 'http-proxy';
import { KBN_KEY_PATH } from '@kbn/dev-utils';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import {
ExternalServiceSimulator,
getExternalServiceSimulatorPath,

View file

@ -8,7 +8,7 @@
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {

View file

@ -8,7 +8,7 @@
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {

View file

@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std';
import getPort from 'get-port';
import http from 'http';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin';

View file

@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std';
import getPort from 'get-port';
import http from 'http';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin';

View file

@ -11,7 +11,7 @@ import { asyncForEach } from '@kbn/std';
import getPort from 'get-port';
import http from 'http';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getServiceNowServer } from '../../../../../common/plugins/actions_simulators/server/plugin';

View file

@ -9,7 +9,7 @@ import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import http from 'http';
import getPort from 'get-port';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getSlackServer } from '../../../../../common/plugins/actions_simulators/server/plugin';

View file

@ -10,7 +10,7 @@ import expect from '@kbn/expect';
import getPort from 'get-port';
import http from 'http';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { getSwimlaneServer } from '../../../../../common/plugins/actions_simulators/server/plugin';

View file

@ -10,7 +10,7 @@ import http from 'http';
import expect from '@kbn/expect';
import { URL, format as formatUrl } from 'url';
import getPort from 'get-port';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
getExternalServiceSimulatorPath,

View file

@ -8,7 +8,7 @@
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '../../../../../common/lib/get_proxy_server';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {

View file

@ -7,14 +7,9 @@
import expect from '@kbn/expect';
import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { UserAtSpaceScenarios } from '../../../scenarios';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../common/lib';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -11,11 +11,10 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server';
import { TaskRunning, TaskRunningStage } from '@kbn/task-manager-plugin/server/task_running';
import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { UserAtSpaceScenarios, Superuser } from '../../../scenarios';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
getTestRuleData,
ObjectRemover,

View file

@ -6,6 +6,7 @@
*/
import expect from '@kbn/expect';
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { UserAtSpaceScenarios } from '../../../scenarios';
import {
getTestRuleData,
@ -13,7 +14,6 @@ import {
ObjectRemover,
getEventLog,
AlertUtils,
ES_TEST_INDEX_NAME,
} from '../../../../common/lib';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';

View file

@ -7,14 +7,9 @@
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../scenarios';
import {
getUrlPrefix,
ObjectRemover,
getTestRuleData,
getEventLog,
ESTestIndexTool,
} from '../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../../common/lib';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -6,16 +6,10 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { UserAtSpaceScenarios } from '../../../scenarios';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import {
getUrlPrefix,
getTestRuleData,
ObjectRemover,
AlertUtils,
ESTestIndexTool,
ES_TEST_INDEX_NAME,
} from '../../../../common/lib';
import { getUrlPrefix, getTestRuleData, ObjectRemover, AlertUtils } from '../../../../common/lib';
// eslint-disable-next-line import/no-default-export
export default function createFindTests({ getService }: FtrProviderContext) {

View file

@ -18,11 +18,11 @@ import axios from 'axios';
import httpProxy from 'http-proxy';
import expect from '@kbn/expect';
import { getHttpProxyServer } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../scenarios';
import { getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import { getSlackServer } from '../../../../common/plugins/actions_simulators/server/plugin';
import { getHttpProxyServer } from '../../../../common/lib/get_proxy_server';
// eslint-disable-next-line import/no-default-export
export default function executionStatusAlertTests({ getService }: FtrProviderContext) {

View file

@ -7,9 +7,10 @@
import expect from '@kbn/expect';
import { SavedObjectsUtils } from '@kbn/core/server';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { UserAtSpaceScenarios, Superuser } from '../../../scenarios';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import { ESTestIndexTool, getUrlPrefix, ObjectRemover, AlertUtils } from '../../../../common/lib';
import { getUrlPrefix, ObjectRemover, AlertUtils } from '../../../../common/lib';
import { setupSpacesAndUsers } from '../../../setup';
// eslint-disable-next-line import/no-default-export

View file

@ -6,14 +6,9 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces, Superuser } from '../../../scenarios';
import {
getUrlPrefix,
getEventLog,
getTestRuleData,
ESTestIndexTool,
TaskManagerDoc,
} from '../../../../common/lib';
import { getUrlPrefix, getEventLog, getTestRuleData, TaskManagerDoc } from '../../../../common/lib';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Space, User } from '../common/types';
import { ES_TEST_INDEX_NAME } from '../common/lib';
const NoKibanaPrivileges: User = {
username: 'no_kibana_privileges',

View file

@ -7,13 +7,9 @@
import expect from '@kbn/expect';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
} from '../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -7,14 +7,9 @@
import type { Client } from '@elastic/elasticsearch';
import expect from '@kbn/expect';
import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -12,11 +12,10 @@ import { Response as SupertestResponse } from 'supertest';
import { RecoveredActionGroup } from '@kbn/alerting-plugin/common';
import { TaskRunning, TaskRunningStage } from '@kbn/task-manager-plugin/server/task_running';
import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Space } from '../../../common/types';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
getTestRuleData,
ObjectRemover,

View file

@ -6,15 +6,11 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
ESTestIndexTool,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib';
import { createEsDocuments } from '../lib/create_test_data';
const RULE_INTERVAL_SECONDS = 6;

View file

@ -7,15 +7,10 @@
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib';
// eslint-disable-next-line import/no-default-export
export default function maxAlertsRuleTests({ getService }: FtrProviderContext) {

View file

@ -7,15 +7,10 @@
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib';
import { createEsDocumentsWithGroups } from '../lib/create_test_data';
const RULE_INTERVAL_SECONDS = 6;

View file

@ -5,14 +5,10 @@
* 2.0.
*/
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { Spaces } from '../../../../scenarios';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { createEsDocuments, createEsDocumentsWithGroups } from '../lib/create_test_data';
export const RULE_TYPE_ID = '.es-query';

View file

@ -7,9 +7,11 @@
import expect from '@kbn/expect';
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ES_TEST_INDEX_NAME, getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { createDataStream, deleteDataStream } from '../lib/create_test_data';
import {
createConnector,

View file

@ -7,9 +7,11 @@
import expect from '@kbn/expect';
import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ES_TEST_INDEX_NAME, getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import {
createConnector,
ES_GROUPS_TO_WRITE,

View file

@ -7,15 +7,11 @@
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
ESTestIndexTool,
ES_TEST_INDEX_NAME,
getUrlPrefix,
ObjectRemover,
getEventLog,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover, getEventLog } from '../../../../../common/lib';
import { createEsDocumentsWithGroups } from '../lib/create_test_data';
import { createDataStream, deleteDataStream } from '../lib/create_test_data';

View file

@ -7,9 +7,11 @@
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
import { getUrlPrefix } from '../../../../../common/lib';
const API_URI = 'internal/triggers_actions_ui/data/_fields';

View file

@ -7,9 +7,11 @@
import expect from '@kbn/expect';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
import { getUrlPrefix } from '../../../../../common/lib';
import { createEsDocumentsWithGroups } from '../lib/create_test_data';
import { createDataStream, deleteDataStream } from '../lib/create_test_data';

View file

@ -8,9 +8,11 @@
import expect from '@kbn/expect';
import { TimeSeriesQuery } from '@kbn/triggers-actions-ui-plugin/server';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
import { getUrlPrefix } from '../../../../../common/lib';
import { createEsDocumentsWithGroups } from '../lib/create_test_data';

View file

@ -7,7 +7,7 @@
import type { Client } from '@elastic/elasticsearch';
import { times } from 'lodash';
import { v4 as uuid } from 'uuid';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '../../../../../common/lib';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
// default end date
export const END_DATE = '2020-01-01T00:00:00Z';

View file

@ -9,15 +9,9 @@ import expect from '@kbn/expect';
import { flatten } from 'lodash';
import { IValidatedEvent } from '@kbn/event-log-plugin/server';
import { DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT } from '@kbn/alerting-plugin/server/config';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
getUrlPrefix,
ObjectRemover,
getTestRuleData,
getEventLog,
ESTestIndexTool,
ES_TEST_INDEX_NAME,
} from '../../../common/lib';
import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -7,14 +7,9 @@
import expect from '@kbn/expect';
import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
getUrlPrefix,
getTestRuleData,
ObjectRemover,
getEventLog,
ESTestIndexTool,
} from '../../../common/lib';
import { getUrlPrefix, getTestRuleData, ObjectRemover, getEventLog } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -6,15 +6,10 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
getUrlPrefix,
ObjectRemover,
getTestRuleData,
getEventLog,
ESTestIndexTool,
} from '../../../common/lib';
import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -6,15 +6,10 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
getUrlPrefix,
ObjectRemover,
getTestRuleData,
getEventLog,
ESTestIndexTool,
} from '../../../common/lib';
import { getUrlPrefix, ObjectRemover, getTestRuleData, getEventLog } from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export

View file

@ -12,13 +12,9 @@ import { Datafeed, Job } from '@kbn/ml-plugin/common/types/anomaly_detection_job
import { MlAnomalyDetectionAlertParams } from '@kbn/ml-plugin/common/types/alerts';
import { ANOMALY_SCORE_MATCH_GROUP_ID } from '@kbn/ml-plugin/server/lib/alerts/register_anomaly_detection_alert_type';
import { ML_ALERT_TYPES } from '@kbn/ml-plugin/common/constants/alerts';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../../../scenarios';
import {
ES_TEST_INDEX_NAME,
ESTestIndexTool,
getUrlPrefix,
ObjectRemover,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
const ACTION_TYPE_ID = '.index';

View file

@ -6,13 +6,13 @@
*/
import expect from '@kbn/expect';
import { ESTestIndexTool } from '@kbn/alerting-api-integration-helpers';
import { Spaces } from '../../scenarios';
import {
getUrlPrefix,
getTestRuleData,
ObjectRemover,
createWaitForExecutionCount,
ESTestIndexTool,
getEventLog,
} from '../../../common/lib';
import { FtrProviderContext } from '../../../common/ftr_provider_context';

View file

@ -7,13 +7,9 @@
import expect from '@kbn/expect';
import { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms';
import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import {
ES_TEST_INDEX_NAME,
ESTestIndexTool,
getUrlPrefix,
ObjectRemover,
} from '../../../../../common/lib';
import { getUrlPrefix, ObjectRemover } from '../../../../../common/lib';
import { Spaces } from '../../../../scenarios';
const ACTION_TYPE_ID = '.index';

View file

@ -21,6 +21,8 @@
"exclude": [
"target/**/*",
"*/plugins/**/*",
"*/packages/**/*",
"*/*/packages/**/*",
],
"kbn_references": [
{ "path": "../../test/tsconfig.json" },
@ -110,5 +112,6 @@
"@kbn/journeys",
"@kbn/alerting-fixture-plugin",
"@kbn/stdio-dev-helpers",
"@kbn/alerting-api-integration-helpers",
]
}

View file

@ -2729,6 +2729,10 @@
version "0.0.0"
uid ""
"@kbn/alerting-api-integration-helpers@link:x-pack/test/alerting_api_integration/packages/helpers":
version "0.0.0"
uid ""
"@kbn/alerts@link:packages/kbn-alerts":
version "0.0.0"
uid ""