[7.x] [FTR] expose new es client service (#51066) (#51173)

* [FTR] expose new es client service (#51066)

* always extend all common config and expose new es client service

* replace `es` service with `legacyEs`

* fix one refernce that's unique to 7.x
This commit is contained in:
Spencer 2019-11-20 19:12:19 -07:00 committed by GitHub
parent c71ac12c61
commit 47631985fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 144 additions and 114 deletions

View file

@ -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;

View file

@ -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', () => {

View file

@ -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'));

View file

@ -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');

View file

@ -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 = [

View file

@ -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 = [

View file

@ -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');

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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 }),

View file

@ -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,
};

View 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'),
});
}

View file

@ -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')) {

View file

@ -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,

View file

@ -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']);

View file

@ -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']);

View file

@ -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,

View file

@ -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');

View file

@ -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);

View file

@ -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);

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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 () => {

View file

@ -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;

View file

@ -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';

View file

@ -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 = () =>

View file

@ -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', () => {

View file

@ -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', () => {

View file

@ -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 () => {

View file

@ -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', () => {

View file

@ -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]: {

View file

@ -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: {

View file

@ -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;

View file

@ -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 () => {

View file

@ -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 {

View file

@ -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,

View file

@ -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 });

View file

@ -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,

View file

@ -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);

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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 = [
{

View file

@ -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';

View file

@ -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', () => {

View file

@ -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) {

View file

@ -5,7 +5,7 @@
*/
export default function ({ getService, loadTestFile }) {
const es = getService('es');
const es = getService('legacyEs');
describe('uptime', () => {
before(() =>

View file

@ -30,7 +30,7 @@ export const services = {
esSupertest: kibanaApiIntegrationServices.esSupertest,
supertest: kibanaApiIntegrationServices.supertest,
es: LegacyEsProvider,
legacyEs: LegacyEsProvider,
esSupertestWithoutAuth: EsSupertestWithoutAuthProvider,
infraOpsGraphQLClient: InfraOpsGraphQLClientProvider,
infraOpsGraphQLClientFactory: InfraOpsGraphQLClientFactoryProvider,

View file

@ -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']);

View file

@ -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']);

View file

@ -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');

View file

@ -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');

View file

@ -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,

View file

@ -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,
};

View file

@ -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,

View file

@ -7,6 +7,6 @@
import { services as apiIntegrationServices } from '../api_integration/services';
export const services = {
es: apiIntegrationServices.es,
legacyEs: apiIntegrationServices.legacyEs,
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
};

View file

@ -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');

View file

@ -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');

View file

@ -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,

View file

@ -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: {

View file

@ -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,
};

View file

@ -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,

View file

@ -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,

View file

@ -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 {

View file

@ -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,

View file

@ -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() {

View file

@ -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,

View file

@ -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,

View file

@ -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 {

View file

@ -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,

View file

@ -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() {

View file

@ -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,

View file

@ -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,

View file

@ -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 {

View file

@ -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,

View file

@ -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,

View file

@ -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'),

View file

@ -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,

View file

@ -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,

View file

@ -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