mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[FTR] expose new es client service (#51066)
* always extend all common config and expose new es client service * replace `es` service with `legacyEs`
This commit is contained in:
parent
063a4f2935
commit
1814957edc
107 changed files with 143 additions and 113 deletions
|
@ -22,7 +22,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const MILLISECOND_IN_WEEK = 1000 * 60 * 60 * 24 * 7;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import {
|
|||
} from './lib';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('index_patterns/* error handler', () => {
|
||||
|
|
|
@ -24,7 +24,7 @@ import { get } from 'lodash';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('telemetry API', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
const BULK_REQUESTS = [
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
const BULK_REQUESTS = [
|
||||
|
|
|
@ -22,7 +22,7 @@ import _ from 'lodash';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('delete', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('export', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('find', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('get', () => {
|
||||
|
|
|
@ -31,7 +31,7 @@ import { SavedObjectsSerializer } from '../../../../src/core/server/saved_object
|
|||
import { SavedObjectsSchema } from '../../../../src/core/server/saved_objects/schema';
|
||||
|
||||
export default ({ getService }) => {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const callCluster = (path, ...args) => _.get(es, path).call(es, ...args);
|
||||
|
||||
describe('Kibana index migration', () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('update', () => {
|
||||
|
|
|
@ -22,7 +22,7 @@ import { ReportManager, METRIC_TYPE } from '@kbn/analytics';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const createStatsMetric = (eventName) => ({
|
||||
key: ReportManager.createMetricKey({ appName: 'myApp', type: METRIC_TYPE.CLICK, eventName }),
|
||||
|
|
|
@ -23,10 +23,7 @@ import { services as commonServices } from '../../common/services';
|
|||
import { KibanaSupertestProvider, ElasticsearchSupertestProvider } from './supertest';
|
||||
|
||||
export const services = {
|
||||
es: commonServices.es,
|
||||
esArchiver: commonServices.esArchiver,
|
||||
retry: commonServices.retry,
|
||||
...commonServices,
|
||||
supertest: KibanaSupertestProvider,
|
||||
esSupertest: ElasticsearchSupertestProvider,
|
||||
randomness: commonServices.randomness,
|
||||
};
|
||||
|
|
33
test/common/services/elasticsearch.ts
Normal file
33
test/common/services/elasticsearch.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { format as formatUrl } from 'url';
|
||||
|
||||
import { Client } from '@elastic/elasticsearch';
|
||||
|
||||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
|
||||
export function ElasticsearchProvider({ getService }: FtrProviderContext) {
|
||||
const config = getService('config');
|
||||
|
||||
return new Client({
|
||||
nodes: [formatUrl(config.get('servers.elasticsearch'))],
|
||||
requestTimeout: config.get('timeouts.esRequestTimeout'),
|
||||
});
|
||||
}
|
|
@ -26,7 +26,7 @@ import * as KibanaServer from './kibana_server';
|
|||
|
||||
export function EsArchiverProvider({ getService, hasService }: FtrProviderContext): EsArchiver {
|
||||
const config = getService('config');
|
||||
const client = getService('es');
|
||||
const client = getService('legacyEs');
|
||||
const log = getService('log');
|
||||
|
||||
if (!config.get('esArchiver')) {
|
||||
|
|
|
@ -18,13 +18,15 @@
|
|||
*/
|
||||
|
||||
import { LegacyEsProvider } from './legacy_es';
|
||||
import { ElasticsearchProvider } from './elasticsearch';
|
||||
import { EsArchiverProvider } from './es_archiver';
|
||||
import { KibanaServerProvider } from './kibana_server';
|
||||
import { RetryProvider } from './retry';
|
||||
import { RandomnessProvider } from './randomness';
|
||||
|
||||
export const services = {
|
||||
es: LegacyEsProvider,
|
||||
legacyEs: LegacyEsProvider,
|
||||
es: ElasticsearchProvider,
|
||||
esArchiver: EsArchiverProvider,
|
||||
kibanaServer: KibanaServerProvider,
|
||||
retry: RetryProvider,
|
||||
|
|
|
@ -21,7 +21,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'home', 'settings', 'discover', 'timePicker']);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import expect from '@kbn/expect';
|
|||
export default function ({ getService, getPageObjects }) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const browser = getService('browser');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const scriptedFiledName = 'versionConflictScript';
|
||||
const PageObjects = getPageObjects(['common', 'home', 'settings', 'discover', 'header']);
|
||||
|
|
|
@ -29,9 +29,7 @@ export default async function ({ readConfigFile }) {
|
|||
|
||||
return {
|
||||
services: {
|
||||
es: commonConfig.get('services.es'),
|
||||
esArchiver: commonConfig.get('services.esArchiver'),
|
||||
retry: commonConfig.get('services.retry'),
|
||||
...commonConfig.get('services'),
|
||||
supertest: KibanaSupertestProvider,
|
||||
supertestWithoutAuth: KibanaSupertestWithoutAuthProvider,
|
||||
esSupertest: ElasticsearchSupertestProvider,
|
||||
|
|
|
@ -12,7 +12,7 @@ const ES_TEST_INDEX_NAME = 'functional-test-actions-index';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function indexTest({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const esTestIndexTool = new ESTestIndexTool(es, retry);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function alertTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const esTestIndexTool = new ESTestIndexTool(es, retry);
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createAlertTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
describe('create', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createDeleteTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
describe('delete', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createDisableAlertTests({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createEnableAlertTests({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const ES_TEST_INDEX_NAME = 'functional-test-actions-index';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function indexTest({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const esTestIndexTool = new ESTestIndexTool(es, retry);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function alertTests({ getService }: FtrProviderContext) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const retry = getService('retry');
|
||||
const esTestIndexTool = new ESTestIndexTool(es, retry);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createAlertTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('create', () => {
|
||||
const objectRemover = new ObjectRemover(supertest);
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createDeleteTests({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('delete', () => {
|
||||
const objectRemover = new ObjectRemover(supertest);
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createDisableAlertTests({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
describe('disable', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function createEnableAlertTests({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
|
||||
describe('enable', () => {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const randomness = getService('randomness');
|
||||
|
||||
describe('assign_tags_to_beats', () => {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('create_enrollment_token', () => {
|
||||
it('should create one token by default', async () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const randomness = getService('randomness');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('enroll_beat', () => {
|
||||
let validEnrollmentToken;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('get_beat_configuration', () => {
|
||||
const archive = 'beats/list';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { ES_INDEX_NAME } from './constants';
|
||||
|
||||
export default function ({ getService, loadTestFile }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('beats', () => {
|
||||
const cleanup = () =>
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const randomness = getService('randomness');
|
||||
|
||||
describe('remove_tags_from_beats', () => {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('set_config', () => {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { ES_INDEX_NAME } from './constants';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('set_tag', () => {
|
||||
it('should create a tag', async () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import moment from 'moment';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const randomness = getService('randomness');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('update_beat', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ export default function ({ getService }) {
|
|||
|
||||
describe('has_privileges', () => {
|
||||
before(async () => {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
await es.shield.postPrivileges({
|
||||
body: {
|
||||
|
@ -104,7 +104,7 @@ export default function ({ getService }) {
|
|||
});
|
||||
|
||||
// Create privilege
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
await es.shield.postPrivileges({
|
||||
body: {
|
||||
[application]: {
|
||||
|
|
|
@ -9,7 +9,7 @@ export default function ({ getService }) {
|
|||
|
||||
describe('post_privileges', () => {
|
||||
it('should allow privileges to be updated', async () => {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const application = 'foo';
|
||||
const response = await es.shield.postPrivileges({
|
||||
body: {
|
||||
|
|
|
@ -22,7 +22,7 @@ const COMMON_HEADERS = {
|
|||
// eslint-disable-next-line import/no-default-export
|
||||
export default ({ getService }: FtrProviderContext) => {
|
||||
const supertest = getService('supertest');
|
||||
const es: Client = getService('es');
|
||||
const es: Client = getService('legacyEs');
|
||||
const callCluster: CallCluster = (((path: 'search', searchParams: SearchParams) => {
|
||||
return es[path].call(es, searchParams);
|
||||
}) as unknown) as CallCluster;
|
||||
|
|
|
@ -8,7 +8,7 @@ import expect from '@kbn/expect';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('load', () => {
|
||||
it('should return the ES cluster info', async () => {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { registerHelpers as registerFollowerIndicesnHelpers } from './follower_i
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const { addCluster, deleteAllClusters } = registerRemoteClustersHelpers(supertest);
|
||||
const {
|
||||
|
|
|
@ -13,7 +13,7 @@ import { getPolicyPayload } from './fixtures';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
getIndex,
|
||||
|
|
|
@ -13,7 +13,7 @@ import { initElasticsearchHelpers } from './lib';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const { getNodesStats } = initElasticsearchHelpers(es);
|
||||
const { loadNodes, getNodeDetails } = registerHelpers({ supertest });
|
||||
|
|
|
@ -15,7 +15,7 @@ import { DEFAULT_POLICY_NAME } from './constants';
|
|||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndex,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { registerHelpers as registerPoliciesHelpers } from './policies.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const { createIndexTemplate, cleanUp: cleanUpEsResources } = initElasticsearchHelpers(es);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './indices.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndex,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './mapping.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndex,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './settings.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndex,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './stats.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndex,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './templates.helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
cleanUp: cleanUpEsResources,
|
||||
|
|
|
@ -13,7 +13,7 @@ import { getRandomString } from './lib';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndexWithMappings,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { registerHelpers } from './rollup.test_helpers';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndexWithMappings,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { getRandomString } from './lib';
|
|||
|
||||
export default function ({ getService }) {
|
||||
const supertest = getService('supertest');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
createIndexWithMappings,
|
||||
|
|
|
@ -13,7 +13,7 @@ import * as beatsMetrics from '../../../../../legacy/plugins/monitoring/server/l
|
|||
import * as apmMetrics from '../../../../../legacy/plugins/monitoring/server/lib/metrics/apm/metrics';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const metricSets = [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
|
||||
export default function ({ getService }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
const config = getService('config');
|
||||
const basic = config.get('esTestCluster.license') === 'basic';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { TelemetrySavedObjectAttributes } from '../../../../../src/legacy/core_p
|
|||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function optInTest({ getService }: FtrProviderContext) {
|
||||
const client: Client = getService('es');
|
||||
const client: Client = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
|
||||
describe('/api/telemetry/v2/optIn API Telemetry User has seen OptIn Notice', () => {
|
||||
|
|
|
@ -106,7 +106,7 @@ export default function({ getService }: FtrProviderContext) {
|
|||
before(async () => {
|
||||
const index = 'heartbeat-8.0.0';
|
||||
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
dateRangeStart = new Date().toISOString();
|
||||
checks = await makeChecks(es, index, testMonitorId, 1, numIps, {}, d => {
|
||||
if (d.summary) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
export default function ({ getService, loadTestFile }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
describe('uptime', () => {
|
||||
before(() =>
|
||||
|
|
|
@ -30,7 +30,7 @@ export const services = {
|
|||
esSupertest: kibanaApiIntegrationServices.esSupertest,
|
||||
supertest: kibanaApiIntegrationServices.supertest,
|
||||
|
||||
es: LegacyEsProvider,
|
||||
legacyEs: LegacyEsProvider,
|
||||
esSupertestWithoutAuth: EsSupertestWithoutAuthProvider,
|
||||
infraOpsGraphQLClient: InfraOpsGraphQLClientProvider,
|
||||
infraOpsGraphQLClientFactory: InfraOpsGraphQLClientFactoryProvider,
|
||||
|
|
|
@ -11,7 +11,7 @@ import mockRolledUpData, { mockIndices } from './hybrid_index_helper';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const retry = getService('retry');
|
||||
const PageObjects = getPageObjects(['common', 'settings']);
|
||||
|
|
|
@ -11,7 +11,7 @@ import { mockIndices } from './hybrid_index_helper';
|
|||
|
||||
export default function ({ getService, getPageObjects }) {
|
||||
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const PageObjects = getPageObjects(['rollup', 'common']);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
|
|||
import { JOB_STATE, DATAFEED_STATE } from '../../../../legacy/plugins/ml/common/constants/states';
|
||||
|
||||
export function MachineLearningAPIProvider({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
const esSupertest = getService('esSupertest');
|
||||
|
|
|
@ -8,7 +8,7 @@ import expect from '@kbn/expect';
|
|||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export function TransformAPIProvider({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ export default function({ getService }: FtrProviderContext) {
|
|||
// Let's delete tokens from `.security-tokens` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index after
|
||||
// some period of time.
|
||||
const esResponse = await getService('es').deleteByQuery({
|
||||
const esResponse = await getService('legacyEs').deleteByQuery({
|
||||
index: '.security-tokens',
|
||||
q: 'doc_type:token',
|
||||
refresh: true,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
es: apiIntegrationServices.es,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
esSupertest: apiIntegrationServices.esSupertest,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
};
|
||||
|
|
|
@ -482,7 +482,7 @@ export default function ({ getService }) {
|
|||
// Let's delete tokens from `.security-tokens` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index
|
||||
// after some period of time.
|
||||
const esResponse = await getService('es').deleteByQuery({
|
||||
const esResponse = await getService('legacyEs').deleteByQuery({
|
||||
index: '.security-tokens',
|
||||
q: 'doc_type:token',
|
||||
refresh: true,
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
import { services as apiIntegrationServices } from '../api_integration/services';
|
||||
|
||||
export const services = {
|
||||
es: apiIntegrationServices.es,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ import { SavedObject } from 'src/core/server';
|
|||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const randomness = getService('randomness');
|
||||
const supertest = getService('supertest');
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import supertestAsPromised from 'supertest-as-promised';
|
|||
const { task: { properties: taskManagerIndexMapping } } = require('../../../../legacy/plugins/task_manager/mappings.json');
|
||||
|
||||
export default function ({ getService }) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const log = getService('log');
|
||||
const retry = getService('retry');
|
||||
const config = getService('config');
|
||||
|
|
|
@ -622,7 +622,7 @@ export default function({ getService }: FtrProviderContext) {
|
|||
// Let's delete tokens from `.security` index directly to simulate the case when
|
||||
// Elasticsearch automatically removes access/refresh token document from the index
|
||||
// after some period of time.
|
||||
const esResponse = await getService('es').deleteByQuery({
|
||||
const esResponse = await getService('legacyEs').deleteByQuery({
|
||||
index: '.security-tokens',
|
||||
q: 'doc_type:token',
|
||||
refresh: true,
|
||||
|
|
|
@ -21,7 +21,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
|
|||
servers: xPackAPITestsConfig.get('servers'),
|
||||
services: {
|
||||
randomness: kibanaAPITestsConfig.get('services.randomness'),
|
||||
es: kibanaAPITestsConfig.get('services.es'),
|
||||
legacyEs: kibanaAPITestsConfig.get('services.legacyEs'),
|
||||
supertestWithoutAuth: xPackAPITestsConfig.get('services.supertestWithoutAuth'),
|
||||
},
|
||||
junit: {
|
||||
|
|
|
@ -8,6 +8,6 @@ import { services as apiIntegrationServices } from '../api_integration/services'
|
|||
|
||||
export const services = {
|
||||
randomness: apiIntegrationServices.randomness,
|
||||
es: apiIntegrationServices.es,
|
||||
legacyEs: apiIntegrationServices.legacyEs,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ import { services as kibanaApiIntegrationServices } from '../../../../../test/ap
|
|||
import { services as kibanaFunctionalServices } from '../../../../../test/functional/services';
|
||||
|
||||
export const services = {
|
||||
es: LegacyEsProvider,
|
||||
legacyEs: LegacyEsProvider,
|
||||
esSupertestWithoutAuth: apiIntegrationServices.esSupertestWithoutAuth,
|
||||
supertest: kibanaApiIntegrationServices.supertest,
|
||||
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
bulkCreateTest,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { createTestSuiteFactory } from '../../common/suites/create';
|
|||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
const {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { importTestSuiteFactory } from '../../common/suites/import';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
importTest,
|
||||
|
|
|
@ -8,7 +8,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles';
|
|||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
|
||||
export default function({ getService, loadTestFile }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
|
||||
describe('saved objects security and spaces enabled', function() {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
resolveImportErrorsTest,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
bulkCreateTest,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { createTestSuiteFactory } from '../../common/suites/create';
|
|||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
const {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { importTestSuiteFactory } from '../../common/suites/import';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
importTest,
|
||||
|
|
|
@ -8,7 +8,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles';
|
|||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
|
||||
export default function({ getService, loadTestFile }: FtrProviderContext) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
|
||||
describe('saved objects security only enabled', function() {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
resolveImportErrorsTest,
|
||||
|
|
|
@ -25,7 +25,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => {
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
bulkCreateTest,
|
||||
|
|
|
@ -23,7 +23,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => {
|
|||
|
||||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
||||
const {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { importTestSuiteFactory } from '../../common/suites/import';
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
importTest,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve
|
|||
export default function({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
resolveImportErrorsTest,
|
||||
|
|
|
@ -34,7 +34,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
|
|||
testFiles: [require.resolve(`../${name}/apis/`)],
|
||||
servers: config.xpack.api.get('servers'),
|
||||
services: {
|
||||
es: LegacyEsProvider,
|
||||
legacyEs: LegacyEsProvider,
|
||||
esSupertestWithoutAuth: config.xpack.api.get('services.esSupertestWithoutAuth'),
|
||||
supertest: config.kibana.api.get('services.supertest'),
|
||||
supertestWithoutAuth: config.xpack.api.get('services.supertestWithoutAuth'),
|
||||
|
|
|
@ -13,7 +13,7 @@ import { copyToSpaceTestSuiteFactory } from '../../common/suites/copy_to_space';
|
|||
export default function copyToSpaceSpacesAndSecuritySuite({ getService }: TestInvoker) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
copyToSpaceTest,
|
||||
|
|
|
@ -13,7 +13,7 @@ import { deleteTestSuiteFactory } from '../../common/suites/delete';
|
|||
export default function deleteSpaceTestSuite({ getService }: TestInvoker) {
|
||||
const supertestWithoutAuth = getService('supertestWithoutAuth');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
|
||||
const {
|
||||
deleteTest,
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TestInvoker } from '../../common/lib/types';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function({ loadTestFile, getService }: TestInvoker) {
|
||||
const es = getService('es');
|
||||
const es = getService('legacyEs');
|
||||
const supertest = getService('supertest');
|
||||
|
||||
describe('spaces api with security', function() {
|
||||
|
|
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