diff --git a/test/common/services/index.ts b/test/common/services/index.ts index d1f63d6fb87465..0561c4047437d8 100644 --- a/test/common/services/index.ts +++ b/test/common/services/index.ts @@ -7,7 +7,6 @@ */ import { DeploymentService } from './deployment'; -import { LegacyEsProvider } from './legacy_es'; import { ElasticsearchProvider } from './elasticsearch'; import { EsArchiverProvider } from './es_archiver'; import { KibanaServerProvider } from './kibana_server'; @@ -19,7 +18,6 @@ import { SavedObjectInfoProvider } from './saved_object_info'; export const services = { deployment: DeploymentService, - legacyEs: LegacyEsProvider, es: ElasticsearchProvider, esArchiver: EsArchiverProvider, kibanaServer: KibanaServerProvider, diff --git a/test/common/services/legacy_es.ts b/test/common/services/legacy_es.ts deleted file mode 100644 index 3766323cf1a4ef..00000000000000 --- a/test/common/services/legacy_es.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -import { format as formatUrl } from 'url'; - -import * as legacyElasticsearch from 'elasticsearch'; - -import { DEFAULT_API_VERSION } from '../../../src/core/server/elasticsearch/elasticsearch_config'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function LegacyEsProvider({ getService }: FtrProviderContext): legacyElasticsearch.Client { - const config = getService('config'); - - return new legacyElasticsearch.Client({ - apiVersion: DEFAULT_API_VERSION, - host: formatUrl(config.get('servers.elasticsearch')), - requestTimeout: config.get('timeouts.esRequestTimeout'), - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts b/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts index 0f82c7f99c5cf4..ea167b0e77e363 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/helper/make_ping.ts @@ -7,13 +7,14 @@ import uuid from 'uuid'; import { merge } from 'lodash'; +import { KibanaClient } from '@elastic/elasticsearch/api/kibana'; import { makeTls, TlsProps } from './make_tls'; const DEFAULT_INDEX_NAME = 'heartbeat-7-generated-test'; const DATA_STREAM_INDEX_NAME = 'synthetics-http-default'; export const makePing = async ( - es: any, + es: KibanaClient, monitorId: string, fields: { [key: string]: any }, mogrify: (doc: any) => any, diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts index df741fe56381ee..768b65453fabcb 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors_fleet.ts @@ -12,7 +12,6 @@ import { makeChecksWithStatus } from './helper/make_checks'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); - const es = getService('legacyEs'); const client = getService('es'); describe('telemetry collectors fleet', () => { @@ -36,7 +35,7 @@ export default function ({ getService }: FtrProviderContext) { }; await makeChecksWithStatus( - es, + client, 'upMonitorId', 1, 1, @@ -55,7 +54,7 @@ export default function ({ getService }: FtrProviderContext) { ); await makeChecksWithStatus( - es, + client, 'downMonitorId', 1, 1, @@ -74,7 +73,7 @@ export default function ({ getService }: FtrProviderContext) { ); await makeChecksWithStatus( - es, + client, 'noGeoNameMonitor', 1, 1, @@ -91,7 +90,7 @@ export default function ({ getService }: FtrProviderContext) { true ); await makeChecksWithStatus( - es, + client, 'downMonitorId', 1, 1, @@ -110,7 +109,7 @@ export default function ({ getService }: FtrProviderContext) { ); await makeChecksWithStatus( - es, + client, 'mixMonitorId', 1, 1, @@ -121,7 +120,7 @@ export default function ({ getService }: FtrProviderContext) { undefined, true ); - await es.indices.refresh(); + await client.indices.refresh(); }); after('unload heartbeat index', () => { @@ -140,7 +139,7 @@ export default function ({ getService }: FtrProviderContext) { }); beforeEach(async () => { - await es.indices.refresh(); + await client.indices.refresh(); }); it('should receive expected results for fleet managed monitors after calling monitor logging', async () => { diff --git a/x-pack/test/api_integration/services/index.ts b/x-pack/test/api_integration/services/index.ts index bf5eaf9618414f..cf439eb7cd5a80 100644 --- a/x-pack/test/api_integration/services/index.ts +++ b/x-pack/test/api_integration/services/index.ts @@ -8,8 +8,6 @@ import { services as kibanaApiIntegrationServices } from '../../../../test/api_integration/services'; import { services as commonServices } from '../../common/services'; -// @ts-ignore not ts yet -import { LegacyEsProvider } from './legacy_es'; // @ts-ignore not ts yet import { EsSupertestWithoutAuthProvider } from './es_supertest_without_auth'; // @ts-ignore not ts yet @@ -29,7 +27,6 @@ export const services = { esSupertest: kibanaApiIntegrationServices.esSupertest, supertest: kibanaApiIntegrationServices.supertest, - legacyEs: LegacyEsProvider, esSupertestWithoutAuth: EsSupertestWithoutAuthProvider, infraOpsSourceConfiguration: InfraOpsSourceConfigurationProvider, infraLogSourceConfiguration: InfraLogSourceConfigurationProvider, diff --git a/x-pack/test/api_integration/services/legacy_es.js b/x-pack/test/api_integration/services/legacy_es.js deleted file mode 100644 index bc0f9946243c8e..00000000000000 --- a/x-pack/test/api_integration/services/legacy_es.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 { format as formatUrl } from 'url'; - -import * as legacyElasticsearch from 'elasticsearch'; - -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { DEFAULT_API_VERSION } from '../../../../src/core/server/elasticsearch/elasticsearch_config'; - -export function LegacyEsProvider({ getService }) { - const config = getService('config'); - - return new legacyElasticsearch.Client({ - apiVersion: DEFAULT_API_VERSION, - host: formatUrl(config.get('servers.elasticsearch')), - requestTimeout: config.get('timeouts.esRequestTimeout'), - }); -}