mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Split core's server-side integration tests into multiple suites (#136539)
* move the integration test files * create the jest config files * fix imports * alright. * move remaining integration tests * fix archive path
This commit is contained in:
parent
927770c157
commit
5aad18fa35
119 changed files with 355 additions and 103 deletions
|
@ -19,7 +19,7 @@ import {
|
|||
InternalHttpServiceSetup,
|
||||
} from '@kbn/core-http-server-internal';
|
||||
import { createHttpServer } from '@kbn/core-http-server-mocks';
|
||||
import { CapabilitiesService, CapabilitiesSetup } from '..';
|
||||
import { CapabilitiesService, CapabilitiesSetup } from '../../capabilities';
|
||||
|
||||
const coreId = Symbol('core');
|
||||
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/capabilities'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/config'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -15,8 +15,8 @@ import { contextServiceMock } from '@kbn/core-http-context-server-mocks';
|
|||
import type { IRouter } from '@kbn/core-http-server';
|
||||
import { HttpService } from '@kbn/core-http-server-internal';
|
||||
import { createHttpServer } from '@kbn/core-http-server-mocks';
|
||||
import { registerRouteForBundle } from '../bundle_routes/bundles_route';
|
||||
import { FileHashCache } from '../bundle_routes/file_hash_cache';
|
||||
import { registerRouteForBundle } from '../../core_app/bundle_routes/bundles_route';
|
||||
import { FileHashCache } from '../../core_app/bundle_routes/file_hash_cache';
|
||||
|
||||
const buildNum = 1234;
|
||||
const fooPluginFixture = resolve(__dirname, './__fixtures__/plugin/foo');
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/core_app'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/elasticsearch'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/execution_context'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -12,6 +12,8 @@ module.exports = {
|
|||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../..',
|
||||
roots: ['<rootDir>/src/core/server'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/http'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/http_resources'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/logging'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/metrics'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -15,7 +15,7 @@ import type { IRouter } from '@kbn/core-http-server';
|
|||
import { contextServiceMock } from '@kbn/core-http-context-server-mocks';
|
||||
import type { HttpService } from '@kbn/core-http-server-internal';
|
||||
import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks';
|
||||
import { ServerMetricsCollector } from '../collectors/server';
|
||||
import { ServerMetricsCollector } from '../../metrics/collectors/server';
|
||||
import { setTimeout as setTimeoutPromise } from 'timers/promises';
|
||||
|
||||
describe('ServerMetricsCollector', () => {
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/node'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/plugins'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -15,4 +15,4 @@ jest.doMock('load-json-file', () => ({
|
|||
}));
|
||||
|
||||
export const mockDiscover = jest.fn();
|
||||
jest.mock('../discovery/plugins_discovery', () => ({ discover: mockDiscover }));
|
||||
jest.mock('../../plugins/discovery/plugins_discovery', () => ({ discover: mockDiscover }));
|
|
@ -17,12 +17,12 @@ import { getEnvOptions, rawConfigServiceMock } from '@kbn/config-mocks';
|
|||
import { loggingSystemMock } from '@kbn/core-logging-server-mocks';
|
||||
import { environmentServiceMock } from '@kbn/core-environment-server-mocks';
|
||||
import { nodeServiceMock } from '@kbn/core-node-server-mocks';
|
||||
import { PluginsService } from '../plugins_service';
|
||||
import { PluginsService } from '../../plugins/plugins_service';
|
||||
import { BehaviorSubject, from } from 'rxjs';
|
||||
import { config } from '../plugins_config';
|
||||
import { config } from '../../plugins/plugins_config';
|
||||
import { coreMock } from '../../mocks';
|
||||
import { AsyncPlugin, PluginType } from '../types';
|
||||
import { PluginWrapper } from '../plugin';
|
||||
import { AsyncPlugin, PluginType } from '../../plugins/types';
|
||||
import { PluginWrapper } from '../../plugins/plugin';
|
||||
|
||||
describe('PluginsService', () => {
|
||||
const logger = loggingSystemMock.create();
|
|
@ -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 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// TODO replace the line below with
|
||||
// preset: '@kbn/test/jest_integration_node
|
||||
// to do so, we must fix all integration tests first
|
||||
// see https://github.com/elastic/kibana/pull/130255/
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/server/integration_tests/saved_objects'],
|
||||
// must override to match all test given there is no `integration_tests` subfolder
|
||||
testMatch: ['**/*.test.{js,mjs,ts,tsx}'],
|
||||
};
|
|
@ -13,7 +13,7 @@ import { errors } from '@elastic/elasticsearch';
|
|||
import type { TaskEither } from 'fp-ts/lib/TaskEither';
|
||||
import type { ElasticsearchClient } from '../../../..';
|
||||
import * as kbnTestServer from '../../../../../test_helpers/kbn_server';
|
||||
import type { SavedObjectsRawDoc } from '../../../serialization';
|
||||
import type { SavedObjectsRawDoc } from '../../../../saved_objects/serialization';
|
||||
import {
|
||||
bulkOverwriteTransformedDocuments,
|
||||
cloneIndex,
|
||||
|
@ -40,18 +40,18 @@ import {
|
|||
transformDocs,
|
||||
waitForIndexStatusYellow,
|
||||
initAction,
|
||||
} from '..';
|
||||
import type { DocumentsTransformFailed, DocumentsTransformSuccess } from '../../core';
|
||||
} from '../../../../saved_objects/migrations/actions';
|
||||
import type {
|
||||
DocumentsTransformFailed,
|
||||
DocumentsTransformSuccess,
|
||||
} from '../../../../saved_objects/migrations/core';
|
||||
|
||||
const { startES } = kbnTestServer.createTestServers({
|
||||
adjustTimeout: (t: number) => jest.setTimeout(t),
|
||||
settings: {
|
||||
es: {
|
||||
license: 'basic',
|
||||
dataArchive: Path.resolve(
|
||||
__dirname,
|
||||
'../../integration_tests/archives/7.7.2_xpack_100k_obj.zip'
|
||||
),
|
||||
dataArchive: Path.resolve(__dirname, '../archives/7.7.2_xpack_100k_obj.zip'),
|
||||
esArgs: ['http.max_content_length=10Kb'],
|
||||
},
|
||||
},
|
|
@ -10,9 +10,12 @@ import { ElasticsearchClient } from '../../../..';
|
|||
import { InternalCoreStart } from '../../../../internal_types';
|
||||
import * as kbnTestServer from '../../../../../test_helpers/kbn_server';
|
||||
import { Root } from '../../../../root';
|
||||
import { isWriteBlockException, isClusterShardLimitExceeded } from '../es_errors';
|
||||
import { createIndex } from '../create_index';
|
||||
import { setWriteBlock } from '../set_write_block';
|
||||
import {
|
||||
isWriteBlockException,
|
||||
isClusterShardLimitExceeded,
|
||||
} from '../../../../saved_objects/migrations/actions/es_errors';
|
||||
import { createIndex } from '../../../../saved_objects/migrations/actions/create_index';
|
||||
import { setWriteBlock } from '../../../../saved_objects/migrations/actions/set_write_block';
|
||||
|
||||
const { startES } = kbnTestServer.createTestServers({
|
||||
adjustTimeout: (t: number) => jest.setTimeout(t),
|
|
@ -16,7 +16,7 @@ import { Env } from '@kbn/config';
|
|||
import { REPO_ROOT } from '@kbn/utils';
|
||||
import { getEnvOptions } from '@kbn/config-mocks';
|
||||
import { LogRecord } from '@kbn/logging';
|
||||
import { retryAsync } from '../test_helpers/retry_async';
|
||||
import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async';
|
||||
|
||||
const kibanaVersion = Env.createDefault(REPO_ROOT, getEnvOptions()).packageInfo.version;
|
||||
const targetIndex = `.kibana_${kibanaVersion}_001`;
|
|
@ -11,7 +11,7 @@ import fs from 'fs/promises';
|
|||
import JSON5 from 'json5';
|
||||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
import { Root } from '../../../root';
|
||||
import { retryAsync } from '../test_helpers/retry_async';
|
||||
import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async';
|
||||
|
||||
const logFilePath = Path.join(__dirname, 'batch_size_bytes_exceeds_es_content_length.log');
|
||||
|
|
@ -17,7 +17,7 @@ import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
|||
import { Root } from '../../../root';
|
||||
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { LogRecord } from '@kbn/logging';
|
||||
import { retryAsync } from '../test_helpers/retry_async';
|
||||
import { retryAsync } from '../../../saved_objects/migrations/test_helpers/retry_async';
|
||||
|
||||
const logFilePath = Path.join(__dirname, 'incompatible_cluster_routing_allocation.log');
|
||||
const env = Env.createDefault(REPO_ROOT, getEnvOptions());
|
|
@ -13,9 +13,9 @@ import Semver from 'semver';
|
|||
import { REPO_ROOT } from '@kbn/utils';
|
||||
import { Env } from '@kbn/config';
|
||||
import { getEnvOptions } from '@kbn/config-mocks';
|
||||
import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { SavedObjectsRawDoc } from '../../serialization';
|
||||
import { SavedObjectsRawDoc } from '../../../saved_objects/serialization';
|
||||
import { InternalCoreStart } from '../../../internal_types';
|
||||
import { Root } from '../../../root';
|
||||
|
|
@ -14,8 +14,8 @@ import { REPO_ROOT } from '@kbn/utils';
|
|||
import { Env } from '@kbn/config';
|
||||
import { getEnvOptions } from '@kbn/config-mocks';
|
||||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { SavedObjectsRawDoc } from '../../serialization';
|
||||
import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { SavedObjectsRawDoc } from '../../../saved_objects/serialization';
|
||||
import { InternalCoreStart } from '../../../internal_types';
|
||||
import { Root } from '../../../root';
|
||||
|
|
@ -12,7 +12,7 @@ import { esTestConfig, kibanaServerTestUser } from '@kbn/test';
|
|||
import { kibanaPackageJson as pkg } from '@kbn/utils';
|
||||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { SavedObjectsType } from '../../types';
|
||||
import { SavedObjectsType } from '../../../saved_objects/types';
|
||||
import type { Root } from '../../../root';
|
||||
|
||||
const LOG_FILE_PREFIX = 'migration_test_multiple_kibana_nodes';
|
|
@ -13,7 +13,7 @@ import { kibanaPackageJson as pkg } from '@kbn/utils';
|
|||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
|
||||
import { Root } from '../../../root';
|
||||
import { deterministicallyRegenerateObjectId } from '../core/document_migrator';
|
||||
import { deterministicallyRegenerateObjectId } from '../../../saved_objects/migrations/core/document_migrator';
|
||||
|
||||
const logFilePath = Path.join(__dirname, 'rewriting_id.log');
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { REMOVED_TYPES } from '../core';
|
||||
import { REMOVED_TYPES } from '../../../saved_objects/migrations/core';
|
||||
import * as kbnTestServer from '../../../../test_helpers/kbn_server';
|
||||
|
||||
// Types should NEVER be removed from this array
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerBulkCreateRoute } from '../bulk_create';
|
||||
import { registerBulkCreateRoute } from '../../../saved_objects/routes/bulk_create';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerBulkGetRoute } from '../bulk_get';
|
||||
import { registerBulkGetRoute } from '../../../saved_objects/routes/bulk_get';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerBulkResolveRoute } from '../bulk_resolve';
|
||||
import { registerBulkResolveRoute } from '../../../saved_objects/routes/bulk_resolve';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerBulkUpdateRoute } from '../bulk_update';
|
||||
import { registerBulkUpdateRoute } from '../../../saved_objects/routes/bulk_update';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerCreateRoute } from '../create';
|
||||
import { savedObjectsClientMock } from '../../service/saved_objects_client.mock';
|
||||
import { registerCreateRoute } from '../../../saved_objects/routes/create';
|
||||
import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerDeleteRoute } from '../delete';
|
||||
import { registerDeleteRoute } from '../../../saved_objects/routes/delete';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,12 +7,12 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerDeleteUnknownTypesRoute } from '../deprecations';
|
||||
import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks';
|
||||
import { typeRegistryMock } from '../../saved_objects_type_registry.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import { registerDeleteUnknownTypesRoute } from '../../../saved_objects/routes/deprecations';
|
||||
import { typeRegistryMock } from '../../../saved_objects/saved_objects_type_registry.mock';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import { SavedObjectsType } from '../../..';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
jest.mock('../../export', () => ({
|
||||
jest.mock('../../../saved_objects/export', () => ({
|
||||
exportSavedObjectsToStream: jest.fn(),
|
||||
}));
|
||||
|
||||
|
@ -15,11 +15,11 @@ import { createListStream } from '@kbn/utils';
|
|||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { savedObjectsExporterMock } from '../../export/saved_objects_exporter.mock';
|
||||
import { SavedObjectConfig } from '../../saved_objects_config';
|
||||
import { registerExportRoute } from '../export';
|
||||
import { setupServer, createExportableType } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { savedObjectsExporterMock } from '../../../saved_objects/export/saved_objects_exporter.mock';
|
||||
import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config';
|
||||
import { registerExportRoute } from '../../../saved_objects/routes/export';
|
||||
import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
const allowedTypes = ['index-pattern', 'search'];
|
|
@ -9,13 +9,13 @@
|
|||
import supertest from 'supertest';
|
||||
import querystring from 'querystring';
|
||||
|
||||
import { registerFindRoute } from '../find';
|
||||
import { registerFindRoute } from '../../../saved_objects/routes/find';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { setupServer } from '../test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { setupServer } from '../../../saved_objects/routes/test_utils';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -7,17 +7,17 @@
|
|||
*/
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerGetRoute } from '../get';
|
||||
import { registerGetRoute } from '../../../saved_objects/routes/get';
|
||||
import { ContextService } from '@kbn/core-http-context-server-internal';
|
||||
import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal';
|
||||
import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks';
|
||||
import { savedObjectsClientMock } from '../../service/saved_objects_client.mock';
|
||||
import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock';
|
||||
import type { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { contextServiceMock, coreMock } from '../../../mocks';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
const coreId = Symbol('core');
|
||||
|
|
@ -9,15 +9,15 @@
|
|||
jest.mock('uuid');
|
||||
|
||||
import supertest from 'supertest';
|
||||
import { registerImportRoute } from '../import';
|
||||
import { registerImportRoute } from '../../../saved_objects/routes/import';
|
||||
import { savedObjectsClientMock } from '../../../mocks';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { SavedObjectConfig } from '../../saved_objects_config';
|
||||
import { setupServer, createExportableType } from '../test_utils';
|
||||
import { SavedObjectsErrorHelpers, SavedObjectsImporter } from '../..';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config';
|
||||
import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils';
|
||||
import { SavedObjectsErrorHelpers, SavedObjectsImporter } from '../../../saved_objects';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
|
|
@ -27,7 +27,7 @@ const exportObjects = [
|
|||
},
|
||||
];
|
||||
|
||||
jest.mock('../lib/export_dashboards', () => ({
|
||||
jest.mock('../../../../saved_objects/routes/legacy_import_export/lib/export_dashboards', () => ({
|
||||
exportDashboards: jest.fn().mockResolvedValue({ version: 'mockversion', objects: exportObjects }),
|
||||
}));
|
||||
|
||||
|
@ -35,10 +35,10 @@ import supertest from 'supertest';
|
|||
import { CoreUsageStatsClient } from '../../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { registerLegacyExportRoute } from '../export';
|
||||
import { setupServer } from '../../test_utils';
|
||||
import { registerLegacyExportRoute } from '../../../../saved_objects/routes/legacy_import_export/export';
|
||||
import { setupServer } from '../../../../saved_objects/routes/test_utils';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../internal_types';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
let coreUsageStatsClient: jest.Mocked<CoreUsageStatsClient>;
|
|
@ -27,7 +27,7 @@ const importObjects = [
|
|||
},
|
||||
];
|
||||
|
||||
jest.mock('../lib/import_dashboards', () => ({
|
||||
jest.mock('../../../../saved_objects/routes/legacy_import_export/lib/import_dashboards', () => ({
|
||||
importDashboards: jest.fn().mockResolvedValue({ objects: importObjects }),
|
||||
}));
|
||||
|
||||
|
@ -35,10 +35,10 @@ import supertest from 'supertest';
|
|||
import { CoreUsageStatsClient } from '../../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { registerLegacyImportRoute } from '../import';
|
||||
import { setupServer } from '../../test_utils';
|
||||
import { registerLegacyImportRoute } from '../../../../saved_objects/routes/legacy_import_export/import';
|
||||
import { setupServer } from '../../../../saved_objects/routes/test_utils';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../internal_types';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../../saved_objects/internal_types';
|
||||
|
||||
type SetupServerReturn = Awaited<ReturnType<typeof setupServer>>;
|
||||
let coreUsageStatsClient: jest.Mocked<CoreUsageStatsClient>;
|
|
@ -6,10 +6,10 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock';
|
||||
import { mockKibanaMigrator } from '../../../saved_objects/migrations/kibana_migrator.mock';
|
||||
|
||||
export const migratorInstanceMock = mockKibanaMigrator.create();
|
||||
export const KibanaMigratorMock = jest.fn().mockImplementation(() => migratorInstanceMock);
|
||||
jest.doMock('../../migrations/kibana_migrator', () => ({
|
||||
jest.doMock('../../../saved_objects/migrations/kibana_migrator', () => ({
|
||||
KibanaMigrator: KibanaMigratorMock,
|
||||
}));
|
|
@ -10,14 +10,14 @@ import supertest from 'supertest';
|
|||
import { ContextService } from '@kbn/core-http-context-server-internal';
|
||||
import type { HttpService, InternalHttpServiceSetup } from '@kbn/core-http-server-internal';
|
||||
import { createHttpServer, createCoreContext } from '@kbn/core-http-server-mocks';
|
||||
import { registerResolveRoute } from '../resolve';
|
||||
import { savedObjectsClientMock } from '../../service/saved_objects_client.mock';
|
||||
import { registerResolveRoute } from '../../../saved_objects/routes/resolve';
|
||||
import { savedObjectsClientMock } from '../../../saved_objects/service/saved_objects_client.mock';
|
||||
import { CoreUsageStatsClient } from '../../../core_usage_data';
|
||||
import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock';
|
||||
import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock';
|
||||
import { executionContextServiceMock } from '@kbn/core-execution-context-server-mocks';
|
||||
import { contextServiceMock, coreMock } from '../../../mocks';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../internal_types';
|
||||
import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types';
|
||||
|
||||
const coreId = Symbol('core');
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue